求教几个C语言问题
1.fopen()函数的问题,fopen几个参数很是不解,r、r+、w、w+,这几个参数到底是有什么区别?谭书上说的我不是很理解。
2.算法与数据结构对于我一名普通非计算机专业的学生来说有点吃力,我看了1个月了,还剩2个月自学完应付考研题来得及么?一方面自己成绩还可以,对计算机也感兴趣,但学到现在感觉有点吃力。
希望前辈们给我一些意见,鼓励和批评都可以,谢谢!!!
[解决办法]
r Open text file for reading. The stream is positioned at the beginning of the file.r+ Open for reading and writing. The stream is positioned at the beginning of the file.w Truncate file to zero length or create text file for writing. The stream is positioned at the beginning of the file.w+ Open for reading and writing. The file is created if it does not exist, otherwise it is truncated. The stream is positioned at the beginning of the file.a Open for appending (writing at end of file). The file is created if it does not exist. The stream is positioned at the end of the file.a+ Open for reading and appending (writing at end of file). The file is created if it does not exist. The initial file position for read-ing is at the beginning of the file, but output is always appended to the end of the file.
[解决办法]
第一个问题 msdn上面讲的很详细了
[解决办法]
算法开始阶段学起来是比较吃力, 静下心才能学到东西.
[解决办法]
r, 只读。 文件必须存在
r+, 读写。文件必须存在
w, 只写。打开/创建文件后,清空文件
w+,读写。打开/创建文件后,清空文件
[解决办法]
数据结构和算法一开始确实不好掌握,我也刚开始学,很多东西我觉得自己得根据书本上讲的好好想想,在纸上画一些图,模拟一下,最后再实现!我就是这么干的
[解决办法]