好久没有写自己的博客了,现在开始又把自己的心思花到学习技术上呢!前面是去考研了,现在已经确定保研了呢。闲话不提太多,下面总结下最近编程中碰到的一个问题。
前不久和同学一起合作参加了一个程序设计比赛(http://dian.org.cn/seedpk),在最后综合代码的时候,却有331个error,而在他那里却没有任何问题。后面搜索以后才知道,因为他使用的新的编译器,支持新的要求。而我编译的用的是VC6.0这个“老古董”了。
问题显示:
error C2275: 'time_t' : illegal use of this type as an expression
这可能是任何的类型都会报错。原因如下:
(declaration)must placed on the beginning of function , In this case, the compile option is key. In VC default compile option, there no problem. But when compile option is strict, this styleof writting can not compile with success.
声明必须在函数的前面,这是C98的标准。新标准中支持使用的时候声明,数组变量的长度可以用变量表示。这也是技术的进步的必然了,信息行业的更新快!要求我们跟上时代呀!