CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to support@ccsinfo.com

[SOLVED] Prototype a struct

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
alan



Joined: 12 Nov 2012
Posts: 357
Location: South Africa

View user's profile Send private message

[SOLVED] Prototype a struct
PostPosted: Fri Oct 11, 2013 6:09 am     Reply with quote

Goodday All

How would one declare the structs below which are referenced in another struct, as they contain pointers to each others definition?
Code:
typedef struct TPB {
  TSCR   *OwnSc;
}TPRB;

typedef struct SCR {
  TPRB *PrgBar;
} TSCR;


V5.012

Regards


Last edited by alan on Fri Oct 11, 2013 1:31 pm; edited 1 time in total
alan



Joined: 12 Nov 2012
Posts: 357
Location: South Africa

View user's profile Send private message

PostPosted: Fri Oct 11, 2013 1:31 pm     Reply with quote

Answer from CCS for those that would like to know:

Code:
Like this:


typedef  TSCR * pTSCR;

typedef struct TPB {
  pTSCR   OwnSc;
}TPRB;

typedef struct SCR {
  TPRB *PrgBar;
} TSCR;

Regards
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group