Pointwise Plugin SDK
Example C-struct Static Initialization

Given the following struct typedefs...

typedef struct SubStruct_t {
const char *str2;
long l;
}
SubStruct;
typedef struct MyStruct_t {
int i;
float f;
SubStruct s;
const char *str1;
}
MyStruct;

The following static initilizers would create an array of 3, MyStruct items at compile-time.

MyStruct ms[] = {
//-------------------------------------------
// initialize ms[0]
{
10, // int i
9.0, // float f
{ // SubStruct s
"str2.0", // const char *str2
1000 // long l
}, // comma is required!
"str1.0" // const char *str1
}, // comma is required here!
//-------------------------------------------
// initialize ms[1]
{
11, // int i
9.1, // float f
{ // SubStruct s
"str2.1", // const char *str2
1001 // long l
}, // comma is required here!
"str1.1" // const char *str1
}, // comma is required here!
//-------------------------------------------
// initialize ms[2]
{
12, // int i
9.2, // float f
{ // SubStruct s
"str2.2", // const char *str2
1002 // long l
}, // comma is required!
"str1.2" // const char *str1
}, // comma is optional here!
};