Click here to Skip to main content
15,895,142 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Reference a struct member variable Pin
manoharbalu17-May-12 4:40
manoharbalu17-May-12 4:40 
GeneralRe: Reference a struct member variable Pin
Albert Holguin17-May-12 8:02
professionalAlbert Holguin17-May-12 8:02 
GeneralRe: Reference a struct member variable Pin
Erudite_Eric17-May-12 19:36
Erudite_Eric17-May-12 19:36 
AnswerRe: Reference a struct member variable Pin
Aescleal17-May-12 4:19
Aescleal17-May-12 4:19 
AnswerRe: Reference a struct member variable Pin
TomasRiker217-May-12 7:36
TomasRiker217-May-12 7:36 
AnswerRe: Reference a struct member variable Pin
Erudite_Eric17-May-12 19:38
Erudite_Eric17-May-12 19:38 
GeneralRe: Reference a struct member variable Pin
Aescleal17-May-12 21:10
Aescleal17-May-12 21:10 
AnswerRe: Reference a struct member variable Pin
Stefan_Lang21-May-12 23:50
Stefan_Lang21-May-12 23:50 
I suggest you go with the suggestion of Erudite_Erik. I took the liberty to put it into code:

C++
struct testsub
{
    float IV [300];
    float NENTH [600];
};

struct test1
{
    // constructor:
    test1(float* iv, float* nenth)
      : IV(iv), NENTH(nenth)    // this initializes the pointer variables
    {
    }

    float* IV;
    char FAIL [200];
    char FD [600];
    float* NENTH;
    float NKVAL [30][600];
    float NLEVEL [600];
    int COUNT;
    int CTIME;
    };

struct test2
{
    // constructor:
    test2(float* iv, float* nenth)
      : RIV(iv), RNENTH(nenth)    // this initializes the pointer variables
    {
    }

    float* RIV;
    float RXX [100];
    char RFAIL [200];
    char RFD [600];
    float RTB [50];
    float* RNENTH;
    char GCD [200];
    float RNKVAL [30][600];
    char MTBD [600];
    float RNLEVEL [600];
    int RCOUNT;
    int RCTIME;
};


void foo()
{
    // allocate objects
    struct testsub * sub = new testsub();
    struct test1 *sim1 = new test1(sub->IV, sub->NENTH);
    struct test2 *sim2 = new test2(sub->IV, sub->NENTH);

    // now do some stuff
    // ...

    // now release memory
    delete sim2;
    delete sim1;
    delete sub;
}

Questionneed help in MFC Pin
jawadali47716-May-12 19:46
jawadali47716-May-12 19:46 
AnswerRe: need help in MFC Pin
Richard MacCutchan16-May-12 21:12
mveRichard MacCutchan16-May-12 21:12 
GeneralRe: need help in MFC Pin
jawadali47716-May-12 21:22
jawadali47716-May-12 21:22 
GeneralRe: need help in MFC Pin
Richard MacCutchan16-May-12 22:48
mveRichard MacCutchan16-May-12 22:48 
GeneralRe: need help in MFC Pin
jeron117-May-12 3:55
jeron117-May-12 3:55 
GeneralRe: need help in MFC Pin
Richard MacCutchan17-May-12 4:42
mveRichard MacCutchan17-May-12 4:42 
GeneralRe: need help in MFC Pin
Aescleal17-May-12 4:13
Aescleal17-May-12 4:13 
GeneralRe: need help in MFC Pin
Pete O'Hanlon17-May-12 4:27
mvePete O'Hanlon17-May-12 4:27 
GeneralRe: need help in MFC Pin
Richard MacCutchan17-May-12 4:43
mveRichard MacCutchan17-May-12 4:43 
GeneralRe: need help in MFC Pin
Aescleal17-May-12 5:24
Aescleal17-May-12 5:24 
QuestionRe: need help in MFC Pin
Pete O'Hanlon17-May-12 7:35
mvePete O'Hanlon17-May-12 7:35 
AnswerRe: need help in MFC Pin
Aescleal17-May-12 22:00
Aescleal17-May-12 22:00 
GeneralRe: need help in MFC Pin
CPallini17-May-12 21:31
mveCPallini17-May-12 21:31 
AnswerRe: need help in MFC Pin
CPallini16-May-12 22:48
mveCPallini16-May-12 22:48 
GeneralRe: need help in MFC Pin
jawadali47717-May-12 0:21
jawadali47717-May-12 0:21 
QuestionRe: need help in MFC Pin
CPallini17-May-12 0:33
mveCPallini17-May-12 0:33 
AnswerRe: need help in MFC Pin
jawadali47717-May-12 17:35
jawadali47717-May-12 17:35 

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.