Click here to Skip to main content
15,914,111 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: Regarding parameter by reference in copy constructor [modified] Pin
prasad_som12-Dec-06 22:16
prasad_som12-Dec-06 22:16 
AnswerRe: Regarding parameter by reference in copy constructor Pin
Rajesh R Subramanian12-Dec-06 22:19
professionalRajesh R Subramanian12-Dec-06 22:19 
AnswerRe: Regarding parameter by reference in copy constructor Pin
Mark Salsbery13-Dec-06 6:23
Mark Salsbery13-Dec-06 6:23 
Questionarray of structure Pin
namy112-Dec-06 22:02
namy112-Dec-06 22:02 
AnswerRe: array of structure Pin
CPallini12-Dec-06 23:00
mveCPallini12-Dec-06 23:00 
QuestionRe: array of structure Pin
namy112-Dec-06 23:20
namy112-Dec-06 23:20 
AnswerRe: array of structure Pin
CPallini13-Dec-06 0:36
mveCPallini13-Dec-06 0:36 
AnswerRe: array of structure Pin
James R. Twine13-Dec-06 2:51
James R. Twine13-Dec-06 2:51 
Table *SomeFuncThatReturnsIt( void )
{
    Table *pTbl = new Table[ 2 ];
 
    if( pTbl )
    {
       // Initialize pTbl[ 0 ]...
       // Initialize pTbl[ 1 ]...
    }
    return( pTbl );
}

   Something like that will allocate the array of structures, initialize them as required, and then return a pointer to the array, or return NULL if allocation fails (if your new works that way).  The caller is now responsible for deallocating the memory referenced by the pointer, of course.

   This is not generally how I like to do things, because I avoid hand-off memory whenever possible, but I believe it will get you in a direction of what you want to do.

   Peace!

-=- James
If you think it costs a lot to do it right, just wait until you find out how much it costs to do it wrong!
Avoid driving a vehicle taller than you and remember that Professional Driver on Closed Course does not mean your Dumb Ass on a Public Road!
DeleteFXPFiles & CheckFavorites
(Please rate this post!)

QuestionDo you know this files structure? Pin
Waldermort12-Dec-06 21:26
Waldermort12-Dec-06 21:26 
AnswerRe: Do you know this files structure? Pin
Steve Echols12-Dec-06 21:46
Steve Echols12-Dec-06 21:46 
GeneralRe: Do you know this files structure? Pin
Waldermort12-Dec-06 22:19
Waldermort12-Dec-06 22:19 
GeneralRe: Do you know this files structure? Pin
David Crow13-Dec-06 7:08
David Crow13-Dec-06 7:08 
QuestionHow to get "general" tab info Pin
LiYS12-Dec-06 21:16
LiYS12-Dec-06 21:16 
AnswerRe: How to get "general" tab info Pin
Mila02513-Dec-06 1:26
Mila02513-Dec-06 1:26 
QuestionRe: How to get "general" tab info Pin
David Crow13-Dec-06 7:11
David Crow13-Dec-06 7:11 
QuestionList Control in sdi application Pin
neha.agarwal2712-Dec-06 21:12
neha.agarwal2712-Dec-06 21:12 
AnswerRe: List Control in sdi application Pin
Naveen12-Dec-06 21:25
Naveen12-Dec-06 21:25 
QuestionRe: List Control in sdi application Pin
David Crow13-Dec-06 7:12
David Crow13-Dec-06 7:12 
QuestionHow display messages in unicode? Pin
Atul2312-Dec-06 20:59
Atul2312-Dec-06 20:59 
AnswerRe: How display messages in unicode? Pin
Naveen12-Dec-06 21:23
Naveen12-Dec-06 21:23 
AnswerRe: How display messages in unicode? Pin
ShilpiP12-Dec-06 23:58
ShilpiP12-Dec-06 23:58 
QuestionTCHAR to string Pin
Programm3r12-Dec-06 20:37
Programm3r12-Dec-06 20:37 
AnswerRe: TCHAR to string Pin
Mila02512-Dec-06 21:00
Mila02512-Dec-06 21:00 
QuestionRe: TCHAR to string Pin
Programm3r12-Dec-06 21:08
Programm3r12-Dec-06 21:08 
AnswerRe: TCHAR to string Pin
Mila02512-Dec-06 21:21
Mila02512-Dec-06 21:21 

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.