by pablo
30.06.2009
De oprichter van de Free Software Foundation, Richard Matthew Stallman, heeft Debian’s besluit om Mono op te nemen als onderdeel van de standaard desktop een stap genoemd, die “de gemeenschap in een riskante richting stuurt.”In een korte verklaring gepubliceerd over de FSF site, stelt Stallman, die in 1984 het GNU-project tot de ontwikkeling van een volledig UNIX-achtig besturingssysteem
Lees het volledige artikel →
by Kristof Bal
03.08.2008
I started studying C when I got an old C handbook from my father’s school, so this was my chance to start to learn to code for real ;).
My first useful result is as a small application that prompts the user to enter an octal, decimal or hexadecimal value and shows its notation in those three ones.
It’s license is BSD, so you can do what you want with it.
Here’s the source:
# include
main()
{
int number;
int decision;
int intputoct();
int inputdec();
int inputhex();
int decider();
void output(int);
printf (“This application converts values from and to octal, decimal and hexadecimal.\n”);
while (1==1) {
decision=decider();
if (decision==8) {
number=inputoct();
output(number);
}
else if (decision==10) {
number=inputdec();
output(number);
}
else if (decision==16) {
number=inputhex();
output(number);
}
else
printf (“Bad input.\n”);
}
}
decider()
{
int type;
printf (“First, choose the type of value to convert.\n8 for octal, 10 for decimal and 16 for hexadecimal.\n”);
scanf (“%d”, &type);
return (type);
}
inputoct()
{
int oct;
printf (“Now, enter the octal value:”);
scanf (“%o”, &oct);
return (oct);
}
inputdec()
{
int dec;
printf (“Now, enter the decimal value:”);
scanf (“%d”, &dec);
return (dec);
}
inputhex()
{
int hex;
printf (“Now, enter the hexadecimal value:”);
scanf (“%x”, &hex);
return (hex);
}
void output(int number)
{
printf (“\nOCT:\t\t%o\nDEC:\t\t%d\nHEX:\t\t%x\n\n”, number, number, number);
}
Lees het volledige artikel →