Hello , Im new member here and i have one question.
on my VS 2010 i wrote a simple code but it didnt debug!! and there is an error message if i pressed Ctrl+F5 "file name" is not recognized as an internal or external command , operable program or batch file.
and if i pressed F5 only it says
"the file name"
the system cannot find the file specified.
what should i do??
yup! if i typed
<
void main()
{
cout<<"David"<<endl;
}
>
the code is done! but if i write a code includes if or for loop or switch the code output is still David o.O
my windows is xp sp3 and i use Visual studio 2010
Note: i didn't type system("pause") but the window didn't hide.
i also didnt make the linker "NO" and the code is done!!!!
<
#include <iostream>
using namespace std;
int main()
{
for(int i=1;i<=100;i++)
cout<<i<<endl;
system("pause")
return 0;
}
>
the result is an error message
Unable to start program 'file path'
The system cannot find the file specified
but if i wrote a simple code like that
<
#include <iostream>
using namespace std;
int main()
{
cout<<"David"<<endl;
system("pause")
return 0;
}
>
and pressed Ctrl+F5 its output is David :/
In both snippets, you're missing the ; after system("pause").
Neither snippet will compile.
If I add the missing ; the first code compiles and runs correctly, displaying numbers from 1 to 100.
PLEASE USE CODE TAGS (the <> formatting button) when posting code. http://v2.cplusplus.com/articles/jEywvCM9/
It makes it easier to read your code and it also makes it easier to respond to your post.
Hint: You can edit your previous post, highlight your code and press the <> formatting button.
Your best bet would be to make a new project. I can't tell you what is happening, you might have tinkered with the project dir and/or changed some projects settings.