Reputation: 187
I'm using Microsoft Visual C++ Express, and I'm wondering what's wrong with the following application, I can't get an output, it gives me an error. Since I'm not English, the error is in a different language, but it basically says something along the lines of 'The system can't find the given/stated path'.
I have literally checked it a dozen times but I can't seem to find what I'm doing wrong. Here's the code:
#include <iostream>
using namespace std;
int DemoConsoleOutput ()
{
cout << "This is a simple string literal" << endl;
cout << "Writing number five:" << 5 << endl;
cout << "Performing division 10/5 = " << 10 / 5 << endl;
cout << "Pi when approximated is 22 / 7 = " << 22 / 7 << endl;
cout << "Pi more accurately is 22 / 7 = " << 22.0 / 7 << endl;
return 0;
}
int main()
{
return DemoConsoleOutput ();
}
Can anyone help me find what's wrong with this?
Addendum: I also keep getting a weird error on my computer every couple minutes. It says: 'a program can't display a message on the desktop' and it gives me the options to show the message, or to give me another reminder in a few minutes. When I click 'show message' my screen goes black for a second and it then gives an error 'The application data folder for Microsoft visual c++ 2010 express could not be created'.
I don't know if it's important, but my OS is windows vista.
Upvotes: 0
Views: 228
Reputation: 9380
From the situation it seems that the application has insufficient rights to create a working folder and write an file in that folder. Possible causes can be that your anti virus is not letting VS do so or the folder has no write rights. Please go through this question.
Upvotes: 1