An extremely powerful computer language on which the foundations of most other mid-level and RAD languages are based. Although it is not object-oriented like C++ and Java, it compiles into tighter code that occupies less space. It is used most frequently for applications designed to run in tight conditions, such as on a computer with a slow CPU and/or a small amount of memory. It is also closer to assembly language than it is to mid-level languages (on the spectrum of computer languages, C is toward the low end of the mid-level languages), making it more difficult to fully master than most languages.
//a more interesting Hello World program
#include <stdio.h>
typedef struct {
int x;
char c50;
void (*func)(char*);
} MY_HELLO_STRUCTURE;
MY_HELLO_STRUCTURE ms;
void draw(char* s) {
printf(s);
}
void main(void) {
ms.x++;
sprintf(ms.c,"Hello World (for the ")
switch (ms.x%10) {
case 1:
sprintf(ms.c+21,"%dst time",ms.x);
break;
case 2:
sprintf(ms.c+21,"%dnd time",ms.x);
break;
case 3:
sprintf(ms.c+21,"%drd time",ms.x);
break;
default:
sprintf(ms.c+21,"%dth time",ms.x);
break;
}
ms.func=draw;
(*ms.func)(ms.c);
return;
}
683👍 350👎