First off, I'm new to C++. I'm taking an intro class at university and have discovered something odd after installing Visual Basic 2008 Express on my laptop.

Here's what I'm doing:

New Project --> Win 32 Console --> Empty --> Add New item --> C++ File

In my new C++ File I'm copy/pasting some very simple code and run it using CTRL-F5. this works fine.

i then select it all and copy/paste some other code I have that is equally simple. I save and then use CTRL-F5 again.

This time it runs the old code that I had deleted and nothing I do can get it to run what's on screen...even if i put in some clear errors that should be called out upon compiling.

I'm probably missing something simple...can you guys help me out?

Try Ctrl-Alt-F7 or Rebuild from the Build menu.

Now it just says "the system cannot find the file specified"...

Try File/Close Solution, accept any changes, and reopen it again

Start over. Delete that file. Create a new C++ file. First post
the simple code into it and run it. Check that it works. Now Paste the
second equally simple code. Now "build" it, either from the tab above
or press F7. Then run it.

Same error as above...

This is happening even for brand new projects (althoiugh not at 100% reproducibility) where I did not copy/paste anything in them and instead started fresh code.

If you're going to try firstPerson's way (which might be for the best at this point, I agree) you shouldn't select "empty project" as it will not set some options that are important.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.