Click here to Skip to main content
15,901,205 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
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 
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 
Hi,
1.) struct Node
{
// various types
} *(*pNode)[7];

this is not a ptr to a 2-dimensional array. This is an array of ptr to ptr.
To make it clearer you can rewrite it:
typedef Node **PtrPtrNode;
PtrPtrNode ppNode[7];

2.) initilalize it as follows:
for (int i = 0; i < 7; i++)
{
pNode[i] = new (Node*);
*(pNode[i]) = new Node[5];
}

3.) filling a node is done as follows:
Node* pNodeArray = NULL;
for (int i = 0; i < 7; i++)
{
pNodeArray = *(pNode[i]);
for (int j = 0; j < 5; j++)
{
pNodeArray[j].Lvl = 0;
}
}

4) releasing:
for (int i = 0; i < 7; i++)
{
delete [](*(pNode[i]));
delete pNode[i];
}
}

I didn't compile it but I hope it's 'error free'
Regards, Tomer
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-&gt;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 
GeneralAbout Windows Services Pin
zahid_ash4-Sep-04 2:34
zahid_ash4-Sep-04 2:34 
GeneralSimple PNG loading... Pin
Joel Holdsworth4-Sep-04 2:17
Joel Holdsworth4-Sep-04 2:17 
GeneralRe: Simple PNG loading... Pin
Chris Losinger4-Sep-04 13:18
professionalChris Losinger4-Sep-04 13:18 

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.