Mac read/write .txt on Xcode C++

z7tjxd45

macrumors member
Original poster
Sep 7, 2011
30
0
Code:
	ifstream fin;
	fin.open("/Users/Mike/Desktop/data.txt");
	if (fin.fail())
	{
		cerr <<"Unable to open data.txt" << endl;
		exit(1);
Is what I have. and Xcode tells me "Error from Debugger. The program being debugged is not being run. I also get an error in terminal.

data.txt is on the desktop. What am I missing here?
 

lights

macrumors newbie
Dec 13, 2011
18
0
Code:
	ifstream fin;
	fin.open("/Users/Mike/Desktop/data.txt");
	if (fin.fail())
	{
		cerr <<"Unable to open data.txt" << endl;
		exit(1);
Is what I have. and Xcode tells me "Error from Debugger. The program being debugged is not being run. I also get an error in terminal.

data.txt is on the desktop. What am I missing here?
I had problems before, what i did was put go into preferences to look for the derived files and put the data text inside the debug folder.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.