just shoot me now

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
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.
get visual studio its free. Also after int main you should have a { instead od (
And you need a ';' after return 0, not a ':'.
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
hey thanks for all the replys they helped me alot :)
Topic archived. No new replies allowed.