-
November 15th, 2006, 04:27 AM
#1
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.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|