what is the errors

January 1, 2011 at 07:57:43
Specs: Windows Vista
Hey I'm a c++ beginer and I wrote this program it is swap two numbers and I don't know what is the errors !!


#include <iostream>
Using namespace std;

void change (double &r, double s)
{
double x = r;
r = s;
s=x;
}

int main ()
{ double k; m;

k = 3;
m = 4;
cout >> k >> ", " >> m >> endl;
change (k, m);

cout << k << ", " << m << endl;

return 0
}


See More: what is the errors

Report •

#1
January 1, 2011 at 08:40:29
I don't know what is the errors !!
These are your errors:
-------------- Build: Debug in cn ---------------

Compiling: main.cpp
main.cpp:2: error: expected constructor, destructor, or type conversion before 'namespace'
main.cpp: In function 'int main()':
main.cpp:12: error: 'm' was not declared in this scope
main.cpp:16: error: 'cout' was not declared in this scope
main.cpp:16: error: 'endl' was not declared in this scope
main.cpp:22: error: expected ';' before '}' token
Process terminated with status 1 (0 minutes, 1 seconds)
5 errors, 0 warnings

Now you know, and knowledge is power!

How To Ask Questions The Smart Way


Report •
Related Solutions


Ask Question