noob help

So I just started a course and wanted some general help and understanding.

when I run a file to test it for errors I trip up an error.

' "c:\Projects\Con........exe"' is not recognized as an internal or external command, operable program or batch file.

Im assuming thats just cause the code makes no sense?

im set for fixing up this code to make it run, with deleting nothing.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
/* This is a program with some
errors in it to be corrected */

#include <iostream>
using namespace std;


int main()
{
	integer     a;
	floating_point   b;
	character   c;

	cout << a << b << c;

	return 0;
}


thanks
a, b and c are not initialized, so you want to print out those variables but cout does not know what to display.
What IDE are you using? When I was using Visual C++ Express 2010 I kept getting that error and another one saying the .exe didn't exist regardless of whether the code was correct or not. I believe at first it said the .exe couldn't be found, then when I clicked build it said it built without errors but Then when I tried to run the program I kept getting the error you are getting.

You should try running a program you know is correct and see if you still get that error.
i ran a code that was correct and it was fine, problem is I think my antivirus locked that exe open, so disabling my antivirus i think solved it. Gonna keep poking at the code till its working before I blame the program first. Visual 2013 express btw.
I'm also using 2013 Express and when I run your code I just get the errors from the code being incorrect. I'm not sure why your antivirus would cause it though.
1
2
3
int a = 10;
float b = 20.0;
char c = 'C';


You also need to initialize the values to something. You can do that by either adding =(insert number or letter here) after each variable like above, or you can use cin statements to take input like below...

1
2
3
4
5
6
 cout << "Enter a number: ";
cin >> a;
cout << "Enter another number: ";
cin >> b;
cout << "Enter a letter: ";
cin >> c;
Last edited on
You aren't initialized a, b and c, but there is something else. I have one near problem with my studio. I solved it when i start compile with win32 (from new project, Win32 Concsole Application) and use this -> #include "stdafx.h".
Think, this will help. :)
closed account (iAk3T05o)
What is character, integer and floating_point.
This is why your antivirus thinks the program is a virus (it's happened to me several times).
you problem is that you use integer instead of int and the other data types have the same problem..

to declare a data type use the following.

for integers use int.
for floating points use float.
for characters use char.
Just to point out how to apply the above suggestions, you can see my output on the right.
1
2
3
4
5
6
7
8
9
10
11
12
#include <iostream>
using namespace std;

int main()
{
	int a=5;
	float b=2.7;
	char c='a';

	cout <<a<<"\n"<<b<<"\n"<<c;
	return 0;
}
5
2.7
a
Topic archived. No new replies allowed.