码迷,mamicode.com
首页 > 系统相关 > 详细

一些关于linux的一些简单的应用

时间:2015-07-31 06:49:21      阅读:173      评论:0      收藏:0      [点我收藏+]

标签:c

#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;
}


一些关于linux的一些简单的应用

标签:c

原文地址:http://10541695.blog.51cto.com/10531695/1680259

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!