Nov 5, 2010 at 2:29am UTC
#include <iostream>
using namespace std;
int main()
{
int postOffice[4] = (1);
}
1>c:\users\yassar\documents\visual studio 2008\projects\larrays\larrays\larrays.cpp(8) : error C2440: 'initializing' : cannot convert from 'int' to 'int [4]'
i dont understand why i get this error massage
thanks in advance
Nov 5, 2010 at 2:31am UTC
Er. That's exactly what it says on the tin. You're trying to assign one integer to an array of integers, which doesn't work in C++.
-Albatross
Nov 5, 2010 at 6:28am UTC
try this
1 2 3 4 5 6 7
int postOffice[4] = {1,0};
array will have 1, 0 , 0 , 0
Last edited on Nov 5, 2010 at 6:28am UTC