Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

C++ Simple testing

Name: Anonymous 2009-01-20 10:48

Sup /prog/, where's the mistake?

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 "{" token


isn't that the right syntax to fill an array? I'm confused.

Name: Anonymous 2009-01-20 13:59

>>9
Show me the sepples way then. I want to have an array with elements {12, 23, 43, 4, 15, 61, 79, 18, 9, 5};

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List