01-29-2003, 11:33 PM
I started learning it about a week ago mb and so far I LOVE IT it´s soooooooooooo awsome!!!!!! everyone should only code in C! although pointers are a nightmear....
Quote:I started learning it about a week ago mb and so far I LOVE IT it´s soooooooooooo awsome!!!!!! everyone should only code in C! although pointers are a nightmear....
#include <stdio.h>
int main(void) {
printf("Hello World\n");
}
int printf(const char *format, ...);
#include <stdio.h>
int main(void) {
int a[10];
int *p;
a[0] = 10;
a[1] = 15;
/* An array variable is a pointer to its first element */
p = a;
/* Easy way */
printf("a[0] = %d, a[1] = %d\n", a[0], a[1]);
/* Pointer way */
printf("a[0] = %d, a[1] = %d\n", *p, *(p + 1));
}
#include <stdio.h>
int main(void) {
int a = 10;
printf("a = %d\n", a);
{
int b = 5;
printf("a = %d, b = %d\n", a, b);
}
}
#define DIM(x) int x;
#define IF if(
#define ELSE } else {
#define ELSEIF } else if(
#define THEN ) {
#define ENDIF }
#include <stdio.h>
int main (void) {
DIM(x)
x = 5;
IF X = 5 THEN
x = x + 1;
ELSEIF x = 10 THEN
x = x + 2;
ELSE
x = x - 2;
ENDIF
}
#include <stdio.h>
int main(void) {
int x;
x = 5;
if( x = 5 ) {
x = x + 1;
} else if( x = 10 ) {
x = x + 2;
} else {
x = x - 2;
}
}
Quote:btw Do anyone here have any tips wich is the best editor/compiler best way to learn how to program API/Graphics (the book only teaches the "theoretical" parts and some simple console stuff = std::cout std::cin...