Name: Anonymous 2009-01-20 10:48
Sup /prog/, where's the mistake?
isn't that the right syntax to fill an array? I'm confused.
class ArrayBox
{
public:
int numbers[9];
//functions
};
int main()
{
ArrayBox ab;
ab.numbers[] = {12, 23, 43, 4, 15, 61, 79, 18, 9, 5};
}
u2.cpp: In function "int main()":
u2.cpp:94: Error: expected primary-expression before "]" token
u2.cpp:94: Error: expected primary-expression before "{" token
u2.cpp:94: Error: expected ";" before "{" tokenisn't that the right syntax to fill an array? I'm confused.