Trying to read data from a file

I'm creating a function that will read data from a .txt file I've written and eventually use the data it reads, but I keep receiving an error message that says my file does not exist. I have no clue just where I'm going wrong.

Here's the warning: 1>.\Debug\P5BoycoHeather.exe.intermediate.manifest : general error c1010070: Failed to load and parse the manifest. The system cannot find the file specified.

This is my code:
ifstream inputFile("input.txt");

string getPuzzleFromFile() //get the puzzle from the file.
{
char getPuzzleFromFile[50];

inputFile >> getPuzzleFromFile;
cout << getPuzzleFromFile << endl;

inputFile.close()

return 0;
}

Any help would be great! Thank you!
I don't know why Microsoft introduced this manifest nonsense. But well look at this:

http://stackoverflow.com/questions/1167523/c-compilation-problems-with-microsoft-visual-studios-2010-beta-1

It seems that you have to change either the encoding or the path of your project
I tried making both changes but I continue to receive the same compiler error. I may just restart my project, maybe I saved it incorrectly?

(And thank you for the link!)
There must be file created with data in it for this to work.Is there file present???(you are taking file for input here so input.txt must be present in folder)

It works for me fine.
just a little problem that it will read only a word from file.and there is no word which will 50 characters in size.Thats just waste of memory.If you want a compile line input then use getline() or get().
Last edited on
Yeah I wasn't too sure what to do to get a word from the file so I made the array size 50 characters just in case.

The input.txt file exists, all the information is present in the folder. Might there be a specific way to save it? Not sure if that's a silly question...
This program works for me.
I created input.txt with sample data in it.(File in Bin folder and to save data use"ctrl + s")
Topic archived. No new replies allowed.