如何在Eclipse IDE中搜索C/C ++文件. [英] how to search a file in Eclipse IDE for C/C++ ..??

查看:130
本文介绍了如何在Eclipse IDE中搜索C/C ++文件.的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在编写一个简单的文件读取程序,但是我的代码找不到该文件.
我正在使用fopen()函数.
请告诉我如何为C/C ++配置Eclipse IDE [wascana eclipse]
查找文件.
还请告诉我如何使用fopen()函数指定文件的总地址来打开文件.前任. >> "c:\ dud \ hyt.txt"

i am writing a simple file read program , but my code can''t find the file.
i am using fopen() function .
Plese tell me how to configure the Eclipse IDE for C/C++[wascana eclipse]
to find the file .
please also tell me how can i open a file by specifying its total address, using fopen() function . ex. >> "c:\dud\hyt.txt"

推荐答案

如果您的代码找不到该文件,则可能是因为您的路径变量不正确.如果使用相对路径,请确保程序从目录树中的正确位置运行.始终最好使用绝对路径,或使用公共文件对话框找到文件.另外,在对路径字符串进行编码时,请确保转义所有反斜杠;例如,例如,您上面的路径字符串应编码为"c:\\dud\\hyt.txt".
If your code cannot find the file then it is probably because your path variable is not correct. If you are using a relative path make sure that your program is running from the correct position in the directory tree. It is always best to use absolute paths, or use the common file dialog to locate your file. Also when coding path strings ensure that you escape all backslashes; e.g your path string above should be coded as "c:\\dud\\hyt.txt".


这篇关于如何在Eclipse IDE中搜索C/C ++文件.的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆