Click here to Skip to main content
15,900,616 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: source of viewport Pin
Hamid_RT23-Jun-06 21:12
Hamid_RT23-Jun-06 21:12 
QuestionHow to measure memory consumption? Pin
nysubmarine23-Jun-06 10:47
nysubmarine23-Jun-06 10:47 
AnswerRe: How to measure memory consumption? Pin
Jun Du23-Jun-06 11:12
Jun Du23-Jun-06 11:12 
QuestionLink errors using std::vector Pin
BuckBrown23-Jun-06 10:22
BuckBrown23-Jun-06 10:22 
AnswerRe: Link errors using std::vector Pin
Neville Franks23-Jun-06 13:27
Neville Franks23-Jun-06 13:27 
QuestionAPI needed Pin
act_x23-Jun-06 9:57
act_x23-Jun-06 9:57 
AnswerRe: API needed Pin
cje23-Jun-06 9:59
cje23-Jun-06 9:59 
AnswerRe: API needed Pin
David Crow23-Jun-06 10:00
David Crow23-Jun-06 10:00 
AnswerRe: API needed Pin
act_x23-Jun-06 10:05
act_x23-Jun-06 10:05 
AnswerRe: API needed Pin
Hamid_RT23-Jun-06 21:08
Hamid_RT23-Jun-06 21:08 
QuestionBinary File IO Pin
Jumpin' Jeff23-Jun-06 9:06
Jumpin' Jeff23-Jun-06 9:06 
AnswerRe: Binary File IO Pin
David Crow23-Jun-06 9:10
David Crow23-Jun-06 9:10 
GeneralRe: Binary File IO Pin
Jumpin' Jeff23-Jun-06 9:41
Jumpin' Jeff23-Jun-06 9:41 
GeneralRe: Binary File IO Pin
David Crow23-Jun-06 9:53
David Crow23-Jun-06 9:53 
GeneralRe: Binary File IO [modified] Pin
Zac Howland23-Jun-06 10:02
Zac Howland23-Jun-06 10:02 
AnswerRe: Binary File IO [modified] Pin
Joe Woodbury23-Jun-06 9:25
professionalJoe Woodbury23-Jun-06 9:25 
GeneralRe: Binary File IO Pin
Jumpin' Jeff23-Jun-06 9:50
Jumpin' Jeff23-Jun-06 9:50 
GeneralRe: Binary File IO Pin
David Crow23-Jun-06 9:55
David Crow23-Jun-06 9:55 
GeneralRe: Binary File IO Pin
Jumpin' Jeff23-Jun-06 9:59
Jumpin' Jeff23-Jun-06 9:59 
GeneralRe: Binary File IO Pin
Joe Woodbury23-Jun-06 10:37
professionalJoe Woodbury23-Jun-06 10:37 
QuestionEntry Points into Exe files Pin
Hibelton23-Jun-06 8:53
Hibelton23-Jun-06 8:53 
AnswerRe: Entry Points into Exe files Pin
ovidiucucu24-Jun-06 7:22
ovidiucucu24-Jun-06 7:22 
QuestionPointers [modified] Pin
Jay0323-Jun-06 8:16
Jay0323-Jun-06 8:16 
AnswerRe: Pointers Pin
Jun Du23-Jun-06 8:52
Jun Du23-Jun-06 8:52 
I'll try to explain line by line.
static ObjectRootPtr ms_instances[MAX_INSTANCES];

Array of static pointers.
//! Static variable definition
RTI::RTIambassador* ObjectRoot::ms_rtiAmb = NULL;
RTI::ObjectClassHandle ObjectRoot::ms_classId = 0;
const char* ObjectRoot::ms_classIdStr = NULL;

Initialization of static and constant static data.
ObjectRootPtr ObjectRoot::ms_instances[MAX_INSTANCES] = // MAX_INSTANCES = 21
{ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL };

Initialization of the static pointers defined by the second line above.

Jay03 wrote:
PS: WHAT DOES THE SECOND LINE MEAN .... ARE YOU MAKING THE POINTER ObjectRootPtr point to class member ms_instances of size 21. I thought it was something like ObjectRootPtr = new ms_instances;


No. It defines an array of pointers. No instantiation involved. It's easy to understand if you replace ObjectRootPtr with ObjectRoot*. The first line defines this replacement.


Best,
Jun
GeneralRe: Pointers Pin
Jay0323-Jun-06 9:19
Jay0323-Jun-06 9:19 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.