IBM Support

How do you initialize a static array by assignment?

Technote (FAQ)


Question

How do you initialize a static array by assignment?

Answer

How to initialize static array by assignment:
In header file:
static int a[6];
 
In cpp file:
int class_3::a[6] = {1,2,3,4,5,6};
 
Resolution:
1 - Enter as initial value {1,2,3,4,5,6}
2 - Click on static
3 - Set the property CPP_CG::Attribute::InitializationStyle = ByAssignment
1519 AnswerProduct versionPartner ContentInternal ContentCategoryReference ID

Historical Number

10459

Document information

More support for: Rational Rhapsody
General Information

Software version: Version Independent

Operating system(s): Platform Independent

Reference #: 1323741

Modified date: 27 October 2010