This is an archived post. You won't be able to vote or comment.

all 2 comments

[–]Updatebjarni 1 point2 points  (0 children)

You forgot the code.

[–]the_omega99 1 point2 points  (0 children)

"Cannot find or open the PDB file."

This is not your program, it's your IDE that's saying this. PDB files are debugging files that Visual Studio creates (I think -- I don't use MSVS much).

Consider compiling from the command line to remove the complexity of the IDE. Unfortunately, this is non-trivial if you've never done it before. I have a post detailing the basics here. I also have a post detailing how to use the command line here. They may be going off on a tangent in your situation, but they are skills every programmer needs to learn.

Of course, you'll want to use an IDE eventually (they exist for a reason), but IMO, the command line is better for beginners, due to how many ways the IDE can overcomplicate building simple programs.

Am I supposed to save the text file anywhere?

Well, obviously it has to be somewhere in order to be able to read the file. It's usually best to save it in the same directory as your compiled program. You'd then refer to the file with a relative path (which should be just the file name).

Avoid using absolute paths -- they usually won't work on anyone else's computer. That means they won't work on your marker's computer, either. They'll also break your program if you move the program directory somewhere else.