【发布时间】:2016-01-28 08:19:39
【问题描述】:
#include "Stdafx.h"
#include "FishTracker.h"
#include <string>
#include "Utils.h"
#include <fstream>
using namespace std;
using namespace cv;
int main()
{
std::string videopath;
videopath = "E:\\TUKLNUST\\fishdata2\\Damo\\AR2-6\\Tetraodontidae_Lagocephalus_sceleratus_AD\\00001\\";
ifstream str;
str.open((videopath + DATA_TXT).c_str());
if (str.is_open())
{
cout << "file is open.";
}
}
文件已打开,但str 是这个。
+ str {_Filebuffer={_Set_eback=0xcccccccc <Error reading characters of string.> _Set_egptr=0xcccccccc <Error reading characters of string.> ...} } std::basic_ifstream<char,std::char_traits<char> >
配置:
win32,调试
Visual Studio 2013
【问题讨论】:
-
你不能在函数之外使用这些语句。
-
是的,我在 main 中使用它们
-
请贴出真实代码!
-
也发布一个真正的问题!说真的,请去研究发布指南,那里解释了您在问题中做错的许多事情。