Click here to Skip to main content
15,913,467 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: hex digit format Pin
David Crow4-Sep-04 16:37
David Crow4-Sep-04 16:37 
GeneralRe: hex digit format Pin
Archer2825-Sep-04 15:51
Archer2825-Sep-04 15:51 
QuestionWhy doesn't this work? Pin
Nemok4-Sep-04 10:25
Nemok4-Sep-04 10:25 
AnswerRe: Why doesn't this work? Pin
Jörgen Sigvardsson4-Sep-04 10:55
Jörgen Sigvardsson4-Sep-04 10:55 
GeneralRe: Why doesn't this work? Pin
Nemok4-Sep-04 11:11
Nemok4-Sep-04 11:11 
GeneralRe: Why doesn't this work? Pin
Jörgen Sigvardsson4-Sep-04 11:13
Jörgen Sigvardsson4-Sep-04 11:13 
GeneralC++ question. Pin
WREY4-Sep-04 9:55
WREY4-Sep-04 9:55 
GeneralRe: C++ question. Pin
cmk4-Sep-04 11:46
cmk4-Sep-04 11:46 
*(*pNode)[7] is the same as :
Node* (*pNode)[7];
And reads as : a pointer to an array of 7 Node pointers.
Two pointers, two things need to be allocated.

1.
*(*pNode)[7] you have two * and an index [7]
*(*(*pNode)+i) you have three * and an index i
These don't match.

Instead use either :
*((*pNode)+i) = NULL;
or,
(*pNode)[i] = NULL;

2. for( ...
Before you can initialize pNode you have to allocate it. Remember pNode is a 'pointer ...'.
i.e.
pNode = (Node*(*)[7])calloc(7, sizeof(Node*));
Also, by using calloc you don't need to loop to initialize.

3. **pNode = new Node;
What are you trying to do ? pNode is a pointer to an array. Here you only ever access first element.
You likely want to use syntax from 1. i.e. (*pNode)[i] = new Node;


Might be able to help more if you explain the context of its use.


...cmk

Save the whales - collect the whole set
GeneralRe: C++ question. Pin
WREY4-Sep-04 12:20
WREY4-Sep-04 12:20 
GeneralRe: C++ question. Pin
WREY5-Sep-04 3:11
WREY5-Sep-04 3:11 
GeneralRe: C++ question. Pin
tomerab5-Sep-04 4:36
tomerab5-Sep-04 4:36 
GeneralRe: C++ question. Pin
WREY5-Sep-04 6:02
WREY5-Sep-04 6:02 
GeneralRe: C++ question. Pin
tomerab5-Sep-04 19:31
tomerab5-Sep-04 19:31 
GeneralTreeView set check with InsertItem Pin
LukeV4-Sep-04 7:00
LukeV4-Sep-04 7:00 
GeneralMultiple Dialog Pin
Grahamfff4-Sep-04 5:59
Grahamfff4-Sep-04 5:59 
GeneralRe: Multiple Dialog Pin
Anonymous4-Sep-04 8:10
Anonymous4-Sep-04 8:10 
GeneralRe: Multiple Dialog Pin
Grahamfff5-Sep-04 8:48
Grahamfff5-Sep-04 8:48 
GeneralUNICODE problem. Pin
Irek Zielinski4-Sep-04 5:43
Irek Zielinski4-Sep-04 5:43 
GeneralRe: UNICODE problem. Pin
Michael Dunn5-Sep-04 6:14
sitebuilderMichael Dunn5-Sep-04 6:14 
GeneralRe: UNICODE problem. Pin
Irek Zielinski5-Sep-04 10:27
Irek Zielinski5-Sep-04 10:27 
GeneralCDC GetWindowExt WinXP->Win98 Pin
FriendOfAsherah4-Sep-04 3:47
FriendOfAsherah4-Sep-04 3:47 
Generalopening a wav file in programming visual c++ Pin
sysrye4-Sep-04 3:26
sysrye4-Sep-04 3:26 
GeneralRe: opening a wav file in programming visual c++ Pin
Joel Holdsworth4-Sep-04 5:34
Joel Holdsworth4-Sep-04 5:34 
GeneralRe: opening a wav file in programming visual c++ Pin
Anonymous4-Sep-04 14:29
Anonymous4-Sep-04 14:29 
QuestionMapping COM port ???? Pin
zahid_ash4-Sep-04 2:38
zahid_ash4-Sep-04 2:38 

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.