So I have started to go back and re-learn how to code in C++, but I have very little programming experience outside of using c++ in college.
My problem is that I cannot get the simplest of programs to work on my windows 7 64 bit laptop. I have tried compiling and building in both code-blocks and VS Express and similar behaviour is experienced in both, except that VS Express will completely crash while code-blocks retains limited functionality.
I have access to a linux install and the code I use in a code-blocks install there works perfectly in it. So I am at a complete loss, because I am certain it is a windows problem, but I cannot find a solution to my problem.
What happens, in my windows machine, both in code-blocks and visual express when I build the program is: it will compile successfully.
However, when the program is run, two different console windows will open, the one which contains "hello" will open and say "hello", and then close. The other console window will remain open containing nothing and cannot be closed when it is created with VS Express. The name of the program remains running in the taskmgr and cannot be killed using taskmgr or even sysinternals processexplorer. VS Express crashes upon the close of the first window and I have to restart to try and begin again.
Codeblocks has similar behaviour, except when I use the "abort" button, the second console window containing nothing will then close. However, the program created "test1.exe" or whatever will still be running and similarly, in the case with the program created with VS Express cannot be closed or killed in any way.
I have no idea why any of this is happening with such basic code. I hope that someone here is able to help :P
Paulus
1 2 3 4 5 6 7 8 9 10
|
#include <iostream>
using namespace std;
int main()
{
cout << "Hello world!" << endl;
return 0;
}
|