linuxに関する簡単な応用

1145 ワード

#include <stdio.h>
#include <stdlib.h>
int main()
{
	printf("file:%s
line:%d
date:%s
time:%s
", __FILE__, __LINE__, __DATE__, __TIME__); \     system("pause"); return 0; } #include <stdio.h> #include <stdlib.h> #define CAT(X,Y) X##Y int main() { printf("%d
", 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
", 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; }