i am new here

Hi everyone, am Enunekwu, from Nigeria and am very new to c++ and other programming language, so am looking for a friend to guide me through it, thanks
Hello enunekwu welcome to the forum. Do you have a particular project that you need help with now? Or are you just introducing yourself?
I have a topic of interest, its the arrays, for example
#include namespace std;

void main() {
int iaArray[4];
iaArray[0] = 1;
iaArray[1] = 2;
iaArray[2] = 3;
iaArray[3] = 4;
cout << iaArray[0] << endl;
cout << iaArray[1] << end;
cout << iaArray[2] << endl;
cout << iaArray[3] << endl;
return 0;
}

if i run it gives me error,
"#include namespace std; "
"void main() {"

Heyas! Welcome to the forum!
The two lines I quoted from you are the ones that are causing errors. For the first, I think you confused #include <iostream> and using namespace std;, both of which you'll need*. For the second, the standard expects main() to be an int, and any compiler that closely follows the standard will complain loudly if it's not.

Best of luck!

-Albatross

*Actually, you don't need the "using namespace std;" line. You could instead prefix all your "cout"s and "endl"s with "std::", which I'd recommend.
Last edited on
thanks Albatross just did it n it work liked charm,
will ask again when i need help
Topic archived. No new replies allowed.