Click here to Skip to main content
15,890,579 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionHow to develop an XML file using VC++ [modified] Pin
kunal.tawde22-May-07 20:12
kunal.tawde22-May-07 20:12 
AnswerRe: How to develop an XML file using VC++ [modified] Pin
Nibu babu thomas22-May-07 20:15
Nibu babu thomas22-May-07 20:15 
AnswerRe: How to develop an XML file using VC++ Pin
Cedric Moonen22-May-07 20:19
Cedric Moonen22-May-07 20:19 
GeneralRe: How to develop an XML file using VC++ Pin
kunal.tawde22-May-07 22:40
kunal.tawde22-May-07 22:40 
AnswerRe: How to develop an XML file using VC++ Pin
Hamid_RT22-May-07 21:05
Hamid_RT22-May-07 21:05 
GeneralRe: How to develop an XML file using VC++ Pin
kunal.tawde22-May-07 22:43
kunal.tawde22-May-07 22:43 
GeneralRe: How to develop an XML file using VC++ Pin
Hamid_RT22-May-07 23:39
Hamid_RT22-May-07 23:39 
QuestionPassing a pointer to a function/dynamic memory allocation Pin
hpjchobbes22-May-07 19:44
hpjchobbes22-May-07 19:44 
I am trying to create a function that takes a pointer as a parameter that will end up being an array. The function returns the number of elements that will be in the array. I'm having a problem with the allocating part in the function. Here is what I have:
<br />
struct FooStruct<br />
{<br />
int aFoo, bFoo;<br />
}<br />
<br />
int GetFooList(FooStruct *pFoos)<br />
{<br />
// Find out the max foos we're going to have<br />
<br />
pFoos = new FooStruct[MaxFoos];<br />
<br />
return MaxFoos;<br />
}<br />


My function works, but the problem comes from the calling function. If I create a pointer to a FooStruct and pass that, it does not get updated with the address that the new comes back with. I still don't fully grasp pointers (just the basics) so I may be going about this the wrong way.

I would imagine that this would be a standard situation with programming (calling a function to get an unknown number of items returned), but I don't know what this would be called so my searches have not come up with anything useful. Is this a good way to achieve what I am looking for, or am I wandering down the wrong path?

Any suggestions or pointers (sorry for the pun) on ways to accomplish this would be greatly appreciated!!
AnswerRe: Passing a pointer to a function/dynamic memory allocation Pin
Cedric Moonen22-May-07 19:58
Cedric Moonen22-May-07 19:58 
AnswerRe: Passing a pointer to a function/dynamic memory allocation Pin
cmk22-May-07 20:02
cmk22-May-07 20:02 
AnswerRe: Passing a pointer to a function/dynamic memory allocation Pin
Arman S.22-May-07 20:04
Arman S.22-May-07 20:04 
AnswerRe: Passing a pointer to a function/dynamic memory allocation Pin
zhang80060522-May-07 20:34
zhang80060522-May-07 20:34 
AnswerRe: Passing a pointer to a function/dynamic memory allocation Pin
David Crow23-May-07 4:21
David Crow23-May-07 4:21 
AnswerRe: Passing a pointer to a function/dynamic memory allocation Pin
hpjchobbes23-May-07 5:03
hpjchobbes23-May-07 5:03 
Questionmenu change for child window Pin
prithaa22-May-07 19:40
prithaa22-May-07 19:40 
AnswerRe: menu change for child window Pin
Anurag Gandhi22-May-07 19:48
professionalAnurag Gandhi22-May-07 19:48 
GeneralRe: menu change for child window Pin
prithaa22-May-07 21:11
prithaa22-May-07 21:11 
Questionerror in a very simple VC++ program Pin
tyagineha22-May-07 19:09
tyagineha22-May-07 19:09 
AnswerRe: error in a very simple VC++ program Pin
Anurag Gandhi22-May-07 19:33
professionalAnurag Gandhi22-May-07 19:33 
GeneralRe: error in a very simple VC++ program Pin
tyagineha22-May-07 20:06
tyagineha22-May-07 20:06 
GeneralRe: error in a very simple VC++ program Pin
Hamid_RT23-May-07 6:17
Hamid_RT23-May-07 6:17 
AnswerRe: error in a very simple VC++ program Pin
Sarath C22-May-07 19:41
Sarath C22-May-07 19:41 
AnswerRe: error in a very simple VC++ program Pin
tyagineha22-May-07 23:32
tyagineha22-May-07 23:32 
GeneralRe: error in a very simple VC++ program Pin
Sarath C22-May-07 23:54
Sarath C22-May-07 23:54 
AnswerRe: error in a very simple VC++ program Pin
tyagineha23-May-07 0:24
tyagineha23-May-07 0:24 

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.