Ohrasta
asked on
Visual Studio 2003 C++ console application console error
I have visual studio 2003 and I am creating a console application under C++. Upon running I can not get my console to correctly work correctly. The console box appears but nothing is visble and no cout statements or cin statements seem to be working. Why?
I already had a 'Test fatal error LNK1201: error writing to program database' error and that problem was solved by disable the 'Microsoft Windows Defender' service. (Anti-spyware). Would there any kind of security program or setting that would stop VS from using the console correctly?
Just for sake I am including the code written.
#include "stdafx.h"
using namespace std;
int main()
{
cout << "Test" << endl;
return 0;
}
no text saying "Test" are ever printed, instead the console window shows up and the application stops responding. Clicking the X will reward in an end task dialog.
I already had a 'Test fatal error LNK1201: error writing to program database' error and that problem was solved by disable the 'Microsoft Windows Defender' service. (Anti-spyware). Would there any kind of security program or setting that would stop VS from using the console correctly?
Just for sake I am including the code written.
#include "stdafx.h"
using namespace std;
int main()
{
cout << "Test" << endl;
return 0;
}
no text saying "Test" are ever printed, instead the console window shows up and the application stops responding. Clicking the X will reward in an end task dialog.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Actually it was a dumb mistake on my behalf. I was choosing console application instead of Win32 Console application. However, itsmeandnobdodyelse has the right idea, points awarded to him.
#include "stdafx.h"
#include <iostream>
using namespace std;
int main()
{
cout << "Test" << endl;
int i;
cin >> i;
return 0;
}
Regards, Alex