Chinaunix首页 | 论坛 | 博客
  • 博客访问: 4255316
  • 博文数量: 1148
  • 博客积分: 25453
  • 博客等级: 上将
  • 技术积分: 11949
  • 用 户 组: 普通用户
  • 注册时间: 2010-05-06 21:14
文章分类

全部博文(1148)

文章存档

2012年(15)

2011年(1078)

2010年(58)

分类: C/C++

2011-05-26 17:38:59

C预处理器提供了 #line 预处理,允许用户设置行号。
使用如下: #line number


  1. #include <stdio.h>

  2. int main()
  3. {
  4.         printf("file %s at the %d is read.\n",__FILE__,__LINE__);
  5.         #line 100
  6.         printf("files %s at the %d is read.\n",__FILE__,__LINE__);

  7.         return 0;
  8. }

  1. ywx@yuweixian:~/yu/c$ ./defi
  2. file defi.c at the 5 is read.
  3. files defi.c at the 100 is read.











阅读(639) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~