Array error and something else
Hi. I get this message when trying to build the below code:
c:\documents and settings\user\my documents\visual studio 2005\projects\lesson6\lesson6\lesson6.cpp(7) : error C2440: 'initializing' : cannot convert from 'int' to 'int [3]'
There are no conversions to array types, although there are conversions to references or pointers to arrays
Code:
#include <iostream>
using namespace std;
int main()
{
int postOffice[3] = (0);
return(0);
}
Now I got this code from the videos that I've been watching and they don't have
in their examples. They also don't declare main() as an int, but it still works fine for them. They are using Microsoft VS 2003, while I'm using Microsoft VS 2005 Express.
I guess that my questions are:
1. Is there a reason why it works fine for them but not for me?;
2. and why do I get the above error code?
Thankyou in advance for anyone that helps. :)
Re: Array error and something else
I think in that low-resolution video they actually have:
Code:
int postOffice[3] = {0};
I hope this helps.
Re: Array error and something else
It does my good man! It does! (or girl... sorry haha)