ok this is what i did on the MVSC++.
1) I chose an empty project
2) Added the .cpp
3) typed the code from the book
"int main ()
{ cout << "Hello,World!\n";
return 0;
}"
Still doesn't work! Here what it said:Unable to start program 'C;\Users\Me\Documents\visual studio 2010\Projects\My first project\Debug\My first project.exe'.
using namespace std; is considered a bad practice. Also, the program doesn't crash. When a console is done, it's default behavior is to close, this is exactly what's supposed to happen. All you're doing with cin.get() is forcing the program to run longer by waiting for a key press.
@DetectiveRawr: That's curious, are you sure your compiler's set up right?
@Volatile Pulse: Huh? To begin with, the reason I told him to cin.get() is because many compilers/IDEs are simply too dumb to automatically pause when the program is completed. Next, crash is figure of speech, I know it completes itself. And last:
using namespace std; is considered a bad practice
I actually works in the field for this stuff, usingnamespace std; is perfectly acceptable for code only you will use (such as what the OP typed). The usual times that's it's unacceptable is when you're producing code (i.e classes and functions) that hundreds/thousands of others will use in their own code. Using it yourself for your programs is perfectly fine.
@Volatile Pulse: Fair enough, I suppose most of them don't have a clue what it means so it could possibly end badly if they try something too advanced. Then again, most people wouldn't know what std:: means either so it's a toss up.
At OP: sounds good, it could possibly be your code, but if it's bitching about not finding a file, usually your compilers having 'ssues.
This is why I dislike MSVS products. Anyways, I just opened it up, and make sure you're building your project.
Build -> Build ProjectName
Since MSVS products come with a built in compiler, they typically come set up and ready to program. You're getting the error due to the fact that you haven't compiled anything yet.
Compile = Build
A faster way to do it is to just press F7.
Edit: I used MSVS10, which may have slightly different menu names/hotkeys
Yes and no, the easiest I've found to me is Code::Blocks, but if you going for a career in programming (namely c++), you might as well get used to it, most companies make you use it. And honestly, it's a good one, it's annoying at times but it's good.
I don't use AVG, it has a lot of "false" alarms. But Code::Blocks is not infected, trust me. So many people, especially programmers, wouldn't all be using C::B if it happened to be infected. Did you try the above mentioned possible solutions? They should enable you to run your program.
This is just something you have to do everytime. This is the biggest difference between scripts and code. Scripts you just double click it, code, you must compile it before you can run it.
Maybe I should uninstall MVSC++ since its complicated :( and reinstall Code::Block. What do you think?
Edit: My uncle told me if I'm gonna start to be in a game development, I need to do things small like 2D. I done some cool stuff on yoyogames.com but the bad thing about is that I can't make 3D games or rpg/mmo games. :( Only 2D. Is this really necessary?
For starting out, I highly suggest code blocks. You just need to be aware that avg may try to block the compiler. Since you're on windows and will no longer have a compiler installed, you need to download the code blocks with MingW. MingW is the compiler half. Code blocks is just an IDE. Together, they enable you to be an efficient coder.
Just remember as Sargon said, MSVS is standard for a lot of companies. It can do so much stuff. But for learning, it's complicated unless you have someone who can show you what the stuff does, or have a tutorial on how to use it. Compare it to photoshop.
Another alternative is writing your code in something like notepad and then compiling directly from the command prompt. This isn't the most efficient way, and is a little more complex for new programmers.
Well I think Code blocks would be perfect for me as a beginner. Maybe MVSC++ is toooo advanced for me. :| cuz it throws multiple things at me that I don't even know :( Oh, where is this Code::Blcosk with MingW?