Click here to Skip to main content
15,888,351 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionBase types and pointer arrays Pin
Richard Andrew x645-Jul-21 18:26
professionalRichard Andrew x645-Jul-21 18:26 
AnswerRe: Base types and pointer arrays Pin
Daniel Pfeffer5-Jul-21 20:56
professionalDaniel Pfeffer5-Jul-21 20:56 
GeneralRe: Base types and pointer arrays Pin
Richard Andrew x646-Jul-21 3:55
professionalRichard Andrew x646-Jul-21 3:55 
AnswerRe: Base types and pointer arrays Pin
Richard MacCutchan5-Jul-21 20:59
mveRichard MacCutchan5-Jul-21 20:59 
GeneralRe: Base types and pointer arrays Pin
Richard Andrew x646-Jul-21 3:56
professionalRichard Andrew x646-Jul-21 3:56 
AnswerRe: Base types and pointer arrays Pin
CPallini5-Jul-21 21:03
mveCPallini5-Jul-21 21:03 
GeneralRe: Base types and pointer arrays Pin
Richard Andrew x646-Jul-21 3:57
professionalRichard Andrew x646-Jul-21 3:57 
AnswerRe: Base types and pointer arrays Pin
jschell17-Jul-21 10:09
jschell17-Jul-21 10:09 
Richard Andrew x64 wrote:
CGsTypeBase** m_Members = new CGsTypeBase*[m_MemberCount]; // Is this the correct way to create an array of pointers?


As others have pointed out the your solution works because of the way the memory lays down.

In the above you have a declaration of a variable which has a type. And you also give the variable a value. But the declaration of the variable is a pointer. Just a pointer. Not a pointer to an array. So when intellisense sees you use it as an array it goes basically 'pointer + 1' isn't going to work. It does works because of the value and not the declaration.

I believe there is a declaration form that allows you to specify the form that would make intellisense happy but been a long time since I attempted C++ so I will leave it to someone else to come up with the form that makes the array specific.
GeneralRe: Base types and pointer arrays Pin
Richard Andrew x6417-Jul-21 13:39
professionalRichard Andrew x6417-Jul-21 13:39 
QuestionLiteral for a short Pin
Richard Andrew x645-Jul-21 11:47
professionalRichard Andrew x645-Jul-21 11:47 
AnswerRe: Literal for a short Pin
Greg Utas5-Jul-21 12:24
professionalGreg Utas5-Jul-21 12:24 
GeneralRe: Literal for a short Pin
Richard Andrew x645-Jul-21 12:55
professionalRichard Andrew x645-Jul-21 12:55 
QuestionDebug Application from Service Pin
Richard Andrew x643-Jul-21 14:16
professionalRichard Andrew x643-Jul-21 14:16 
AnswerRe: Debug Application from Service Pin
Daniel Pfeffer3-Jul-21 17:24
professionalDaniel Pfeffer3-Jul-21 17:24 
AnswerRe: Debug Application from Service Pin
Richard MacCutchan3-Jul-21 21:11
mveRichard MacCutchan3-Jul-21 21:11 
AnswerRe: Debug Application from Service Pin
Joe Woodbury4-Jul-21 17:14
professionalJoe Woodbury4-Jul-21 17:14 
GeneralRe: Debug Application from Service Pin
Richard Andrew x645-Jul-21 6:25
professionalRichard Andrew x645-Jul-21 6:25 
QuestionMultiple view ports in single window using opengl and c++ Pin
Member 107421151-Jul-21 23:15
Member 107421151-Jul-21 23:15 
SuggestionRe: Multiple view ports in single window using opengl and c++ Pin
CHill601-Jul-21 23:16
mveCHill601-Jul-21 23:16 
AnswerRe: Multiple view ports in single window using opengl and c++ Pin
Richard MacCutchan1-Jul-21 23:59
mveRichard MacCutchan1-Jul-21 23:59 
QuestionNative VS Debugger Question - SOLVED Pin
Richard Andrew x6428-Jun-21 10:39
professionalRichard Andrew x6428-Jun-21 10:39 
AnswerRe: Native VS Debugger Question Pin
Richard MacCutchan28-Jun-21 21:03
mveRichard MacCutchan28-Jun-21 21:03 
GeneralRe: Native VS Debugger Question Pin
Richard Andrew x6429-Jun-21 10:07
professionalRichard Andrew x6429-Jun-21 10:07 
GeneralRe: Native VS Debugger Question Pin
Richard MacCutchan29-Jun-21 10:16
mveRichard MacCutchan29-Jun-21 10:16 
QuestionMessage Closed Pin
27-Jun-21 5:05
Member 1496877127-Jun-21 5:05 

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.