Click here to Skip to main content
16,006,065 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Updating all active documents Pin
David Crow10-Jul-03 8:37
David Crow10-Jul-03 8:37 
GeneralRe: Updating all active documents Pin
John R. Shaw10-Jul-03 11:42
John R. Shaw10-Jul-03 11:42 
GeneralDockable Window Pin
fluxt10-Jul-03 8:14
fluxt10-Jul-03 8:14 
GeneralRe: Dockable Window Pin
Chris Richardson10-Jul-03 13:23
Chris Richardson10-Jul-03 13:23 
Generalaccessing the elements of a struct from another class Pin
johnstonsk10-Jul-03 7:53
johnstonsk10-Jul-03 7:53 
GeneralRe: accessing the elements of a struct from another class Pin
David Crow10-Jul-03 8:51
David Crow10-Jul-03 8:51 
GeneralRe: accessing the elements of a struct from another class Pin
johnstonsk10-Jul-03 8:53
johnstonsk10-Jul-03 8:53 
GeneralRe: accessing the elements of a struct from another class Pin
David Crow10-Jul-03 10:04
David Crow10-Jul-03 10:04 
Saying "struct container" is redundant as a struct is a container of (different) data types.

That aside, I'm not sure what you are asking. Your RFMAccess class has a TSimHeader structure in it with 10 instances defined. In order to access any one instance, you'll need to use square brackets like you've shown. It makes no difference whether you use TSimHeader_arr[i], or s[i].

Here's a kludgy example:

class MyOtherClass
{
    // a pointer to a single instance
    struct RFMAccess::TSimHeader *ts;

    void foo( int x )
    {
        // point to the instance
        ts = &(RFMAccess::TSimHeader_arr[x]);
    }
};


You could also add the following function to your RFMAccess class:

static struct TSimHeader *GetSingleInstance( int x )
{
    return (&TSimHeader_arr[x]);
}


And use it in another class like:

void foo2( void )
{
    struct RFMAccess::TSimHeader *ts;
    ts = RFMAccess::GetSingleInstance(0);
}


Notice that qualification is still necessary for both usages.
GeneralRe: accessing the elements of a struct from another class Pin
johnstonsk10-Jul-03 10:20
johnstonsk10-Jul-03 10:20 
General(cin>>x).get( ); Pin
DaveE9th10-Jul-03 7:44
DaveE9th10-Jul-03 7:44 
GeneralRe: (cin>>x).get( ); Pin
Nick Parker10-Jul-03 8:25
protectorNick Parker10-Jul-03 8:25 
GeneralRe: (cin>>x).get( ); Pin
John M. Drescher10-Jul-03 10:38
John M. Drescher10-Jul-03 10:38 
GeneralRe: (cin>>x).get( ); Pin
Michael Dunn10-Jul-03 13:30
sitebuilderMichael Dunn10-Jul-03 13:30 
GeneralRe: (cin>>x).get( ); Pin
Nick Parker10-Jul-03 18:10
protectorNick Parker10-Jul-03 18:10 
GeneralRe: (cin>>x).get( ); Pin
DaveE9th10-Jul-03 21:57
DaveE9th10-Jul-03 21:57 
GeneralRe: (cin>>x).get( ); Pin
Ryan Binns10-Jul-03 22:46
Ryan Binns10-Jul-03 22:46 
GeneralRe: (cin>>x).get( ); Pin
DaveE9th11-Jul-03 7:27
DaveE9th11-Jul-03 7:27 
GeneralRe: (cin>>x).get( ); Pin
Ryan Binns11-Jul-03 15:59
Ryan Binns11-Jul-03 15:59 
GeneralRe: (cin>>x).get( ); Pin
DaveE9th12-Jul-03 2:29
DaveE9th12-Jul-03 2:29 
Generalbtrees in STL Pin
Anonymous10-Jul-03 7:43
Anonymous10-Jul-03 7:43 
GeneralRe: btrees in STL Pin
valikac10-Jul-03 7:48
valikac10-Jul-03 7:48 
GeneralRe: btrees in STL Pin
David Crow10-Jul-03 8:58
David Crow10-Jul-03 8:58 
GeneralRe: btrees in STL Pin
Anonymous10-Jul-03 12:24
Anonymous10-Jul-03 12:24 
GeneralRe: btrees in STL Pin
David Crow11-Jul-03 3:08
David Crow11-Jul-03 3:08 
GeneralRe: btrees in STL Pin
Nemanja Trifunovic10-Jul-03 9:09
Nemanja Trifunovic10-Jul-03 9:09 

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.