#include <stdio.h> #include <stdlib.h> int main() { printf("file:%s\nline:%d\ndate:%s\ntime:%s\n", __FILE__, __LINE__, __DATE__, __TIME__); system("pause"); return 0; } #include <stdio.h> #include <stdlib.h> #define CAT(X,Y) X##Y int main() { printf("%d\n", CAT(3, 4)); // system("pause"); // return 0; //} //#include <stdio.h> //#include <stdlib.h> //#define PRINT(FOMAL,VALUE) printf("the value of "#VALUE" is "FOMAL"",VALUE) //int main() //{ // int a = 10; // PRINT("%d", a); // system("pause"); // return 0; //} //#include <stdio.h> //#include <stdlib.h> //#define MAX(X,Y) (X)>(Y)?(X):(Y) //int main() //{ // int a = 10; // int b = 20; // int ret = MAX(a, b); // printf("MAX=%d\n", ret); // system("pause"); // return 0; //} #include <stdio.h> #include <stdlib.h> #define MALLOC(NUM,TYPE) ((TYPE*)malloc(NUM*sizeof(TYPE)) int main() { int *p = (int *)malloc(10 * sizeof(int)); free(p); p = NULL; system("pause"); return 0; }
时间: 2024-10-19 01:00:44