
c
AllyLi0224
这个作者很懒,什么都没留下…
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
error: expected declaration specifiers or '...' before XXX【神奇的错误】
当 A 包含 B 的头文件,B 又包含 A 的头文件,就出现了这个error。 解决方法:检查并删掉其中重复包含的头文件。原创 2020-03-07 23:34:50 · 1576 阅读 · 0 评论 -
c的文本操作
/*C语言使用文件的例子*/ #include /*文件的访问可以使用二进制的形式访问,也可以使用文本方式访问,在C中,是依靠打开文件时的参数来确定的,以二进制方式访问的文件在以记事本等方式打开时看到的可能是乱码,具体的操作如下:*/ /*功能:以文本方式生成一个文件,将"50 100 150"等数字输出到文件中 输入:无 输出:无 返回:无 */ void write_TXT_file(原创 2017-05-10 17:54:20 · 648 阅读 · 0 评论 -
centos中C环境码代码移动大量文件
在linux系统纯c环境中: #include //加载头文件 int rename(const char *oldname, const char *newname); //函数声明 举例使用: test.cpp、test.txt与home文件夹放在同一目录下,那么如果想通过test.cpp将test.txt放入home文件夹, 则:: rename("test原创 2017-05-10 11:02:21 · 520 阅读 · 0 评论 -
centos中c环境字符串拼接
#include #include int main () { char str[80]; strcpy (str,"these "); strcat (str,"strings "); strcat (str,"are "); strcat (str,"concatenated."); puts (str); return 0;原创 2017-05-10 11:05:12 · 699 阅读 · 0 评论 -
centos中c遍历目录文件例子
以下是很有意思的c遍历文件目录的代码,值得回味: #include #include #include #include #include int readFileList(char *basePath) { DIR *dir; struct dirent *ptr; char base[1000]; if ((dir=opendir(basePath原创 2017-05-10 11:08:32 · 1429 阅读 · 0 评论