[try Beta version]
Not logged in

 
just shoot me now

Dec 12, 2009 at 6:01am
ok people im a new to c++ and i cant even executed.a file. well i dont know how i have the c++ note pad and codeblocks. ill put this in
// my first program in C++

#include <iostream>
using namespace std;

int main ()
(
cout << "Hello world!";
return 0:
}

after i do that i save the file as a .exe file. but when i go to codeblock all it does is bring up the same thing . so please tell me what i need to do
Dec 12, 2009 at 6:06am
You need to compile the code.

Save the code as a .cpp file.

If you are using code blocks:
- Write your code
- Save it as a .cpp file
- Click 'build' on the top menu
- Click 'build and run' on the drop down menu.

It should compile your program into an .exe file and run it.
Dec 12, 2009 at 6:06am
Dec 12, 2009 at 6:07am
get visual studio its free. Also after int main you should have a { instead od (
Dec 12, 2009 at 6:17am
And you need a ';' after return 0, not a ':'.
Dec 12, 2009 at 11:20am
in notepad++, if you click the console button then simply compile using: g++ filename assuming your using mingw or GNU, etc (the console button opens up a small window tabbed to notepad++ that is just a copy of windows command line, however notepad++ usually open by default the same location of the file you are working on, so typing pwd you should be in the same directory as your file, otherwise simply change directory to same folder as the file you are working on.

if any other compiler then look up the manual for that compiler. most are pretty much the same.

Additionally, if you have cygwin installed, adding the cygwin paths to windows environment variable PATH allows you to use unix tools from within notepad++ and windows command line.
Last edited on Dec 12, 2009 at 11:28am
Dec 12, 2009 at 3:33pm
hey thanks for all the replys they helped me alot :)
Topic archived. No new replies allowed.