All articles| All Pictures| All Softwares| All Video| Go home page| Write articles| Upload pictures

Reading number is top 10 articles
Beautiful! These 3D “Kung Fu“ action you must have never seen
Apple Samsung Smartphone industry 109% control profits? ,
同名不同命:不同后缀与.com域名价格差多少? - 域名
700M“数字红利”频段难用于4G,广电拒放手 - 700MHz,广电
京东43亿元投资永辉超市,获10%股份 - 京东,永辉超市
不只特斯拉:马斯克和他改变世界的十大发明 - 埃隆马斯克,特斯拉,paypal
GPA5.1,美国女学霸获26所高校录取通知 - 大学生,教育
For the extinction of a physical keyboard, humans do this,
福昌之“死”,手机供应链危机四伏 - 智能手机,供应链
618 Amazon launches first hit with cell phones,
Reading number is top 10 pictures
西游四格漫画(二)
Female model behind the bitterness, often being overcharged2
中国文革时期的色情图片1
Ashlynn Brooke show proud chest measurement3
Parking technology is great, that give you the keys can't stolen
2012 national geographic daily picture3
Discharge accidentally Actresses by the breast3
男人巳快沦落成动物了
China telecom 114 spokesman MeiYanXu1
这才是真正的人体艺术3
Download software ranking
Boxer vs Yellow1
SQL2000 For 4IN1
Twenty piece of palm leaf
Prostitutes diary
Ashlynn Video5
asp.netWeb服务器高级编程
DreamWeaver8
jdk1.6 for windows
虚拟机5.5.3版
电车之狼R
delv published in(发表于) 2014/1/8 7:47:45 Edit(编辑)
It turns out, Linux is always Number 1

It turns out, Linux is always Number 1(事实证明,Linux总是Number 1,)

Turns out, Linux Number 1-Linux,Linux always order programming-IT news Turns out, Linux was always Number 1

Hi, I'm writing a simple program, I want to let this program prints out a whole number.



#include


int main() {


int linux = 701;


printf("%d", linux);


return 0;


}


Simple enough. : Really?


I put it into the code.c


I now compile and run it:


$ gcc code.c && ./a.out


Bad! Compile failed, and receive the following error message:


code.c: In function'main':


code.c:4:6: error: expected identifier or'('before numeric constant


int linux = 701;


^


Confusing!!


After Googling this error information – this is the error code needs to be preprocessed.


So, I bring the-e argument at compile time, it can compile stops after preprocessing:


$ gcc -E code.c


Preprocessed main () function code appears as follows:


int main() {


int 1 = 701;


printf("%d\n", 1);


return 0;


}


I passed out! C-language editor of preprocessing Linux changed the variable the integer 1. When the compiler encounters an int 1=701; statement, throws an error.


Now, I'm no Linux assign any values to variables:


#include


int main() {


printf("%d\n", linux);


return 0;


}


To compile and run:


$ gcc code.c && ./a.out


It compiles successfully and the output:


1


Turns out, Linux is Number1



(

事实证明,Linux总是Number 1 - Linux,Linux命令,编程 - IT资讯
事实证明,Linux总是Number 1

嗨,我正在写一个简单的程序,我要让这个程序打印出一个整数。



#include


int main() {


int linux = 701;


printf("%d", linux);


return 0;


}


够简单吧。真的吗?


我把它存成了code.c


现在我编译并运行它:


$ gcc code.c && ./a.out


糟糕!,编译失败,出现了下面的错误信息:


code.c: In function‘main’:


code.c:4:6: error: expected identifier or‘(’before numeric constant


int linux = 701;


^


困惑!!


在谷歌上搜索这个错误——得到的信息是这种错误需要对代码进行预处理。


于是,我在编译时带上了-E参数,它能让编译在预处理后停止:


$ gcc -E code.c


预处理过的main()函数代码显示如下:


int main() {


int 1 = 701;


printf("%d\n", 1);


return 0;


}


我晕!C语言的预处理编辑器竟然将变量linux换成了整数1。当编译器遇到了int 1 = 701;语句时,抛出了错误。


现在,我不对变量linux赋任何值:


#include


int main() {


printf("%d\n", linux);


return 0;


}


编译并运行:


$ gcc code.c && ./a.out


编译成功并且输出:


1


事实证明,linux总是Number1


)


添加到del.icio.us 添加到新浪ViVi 添加到百度搜藏 添加到POCO网摘 添加到天天网摘365Key 添加到和讯网摘 添加到天极网摘 添加到黑米书签 添加到QQ书签 添加到雅虎收藏 添加到奇客发现 diigo it 添加到饭否 添加到飞豆订阅 添加到抓虾收藏 添加到鲜果订阅 digg it 貼到funP 添加到有道阅读 Live Favorites 添加到Newsvine 打印本页 用Email发送本页 在Facebook上分享


Disclaimer Privacy Policy About us Site Map

If you have any requirements, please contact webmaster。(如果有什么要求,请联系站长)
Copyright ©2011-
uuhomepage.com, Inc. All rights reserved.