Q1)
I have come across the need to create a table of strings (char*).
The table should be declared in header file and defined in cpp to avoid multiple definitions.
What I did is I've put it like this in the header:
- cpp Code: Select all
extern char * myCharMap[4];
In my cpp file:
- cpp Code: Select all
char * myCharMap[4] = {"123","abcdef","ghjikl","mnoprstqrst"};
Now as far as I've tested, this works correctly and I avoid multiple definitions, Is this a correct way to go about this?
Q2)
I have been looking in irrlicht SEvent structure. It contains event type and an union that contains and structures for every event type.
Now by looking at those event structures I could say that they differ in size. Can unions contain structures with any kind of data in them? Does the data in structures have to be in some sort of order?


