Sweety

Practice makes perfect

导航

2017年5月25日

摘要: 由于Linux下没有gets函数,所以提示函数警告 warning: the `gets' function is dangerous and should not be used.用fgets代替就行了。函数算在头文件:#include 函数原型: int fgetc(FILE *st... 阅读全文

posted @ 2017-05-25 21:01 蓝空 阅读(1465) 评论(0) 推荐(0) 编辑

摘要: 原网址:here有时用了freopen,怎么搞都不能从控制台输入输出了,相当郁闷。于是总结了一下用freopen后恢复到控制台的方法。方法一、 在freopen前,调用dup把标准输出的文件描述符保存起来 old = _dup( 1 ); ... 阅读全文

posted @ 2017-05-25 20:54 蓝空 阅读(772) 评论(0) 推荐(0) 编辑

摘要: 今天从window上一直c++程序到Linux上,但是原来写的itoa提示不能用了,然后用下面解决。。。。比较简洁的方法是用sprintf()函数代替。具体代码如下:#include #include int main() { int number = 429496729; ... 阅读全文

posted @ 2017-05-25 19:25 蓝空 阅读(1176) 评论(0) 推荐(0) 编辑