C++从Txt中读取内容
2015-10-14 11:46
169 查看
void Text::ReadTxt()
{
CString strFilePath;
strFilePath= strFilePath+ "\\Text.txt";
FILE *fp;
fp = fopen(strCurWorkPath,"r");
if (fp)
{
double dLon = 0.0;
double dLat = 0.0;
int ID = 0;
for (int j = 0; j < 310; j++)
{
if (feof(fp))
{
break;
}
fscanf(fp,"%lf%lf%d\r\n",&dLon,&dLat,&ID);
}
}
fclose(fp);
}
{
CString strFilePath;
strFilePath= strFilePath+ "\\Text.txt";
FILE *fp;
fp = fopen(strCurWorkPath,"r");
if (fp)
{
double dLon = 0.0;
double dLat = 0.0;
int ID = 0;
for (int j = 0; j < 310; j++)
{
if (feof(fp))
{
break;
}
fscanf(fp,"%lf%lf%d\r\n",&dLon,&dLat,&ID);
}
}
fclose(fp);
}
相关文章推荐
- C++获取可执行文件的路径
- C语言程序初体验
- c++ 容器学习 理论
- 剑指offer第六题【旋转数组的最小数字】c++实现
- C++调用C#的DLL程序实现方法
- 一些关于C++ 内存管理的比较好的文章,代码
- OpenGL C++
- c语言日常 10_10练习
- c语言日常 10_8练习
- 解析C++的虚函数表
- c++单例三种实现
- 堆排序C++
- 雪*C语言核心知识总结二
- C++ 类成员函数后面加 const关键字
- C语言程序100例之C#版-029
- Cpp--C++中排序常用(菜鸟上路,持续更新)
- 程序员---C语言细节7(增加两个整数溢出检测)
- C语言基础
- Longest Substring Without Repeating Characters - Leetcode
- [c++] LeetCode Two Sum问题