Login | Register   
LinkedIn
Google+
Twitter
RSS Feed
Download our iPhone app
TODAY'S HEADLINES  |   ARTICLE ARCHIVE  |   FORUMS  |   TIP BANK
Browse DevX
Sign up for e-mail newsletters from DevX


Tip of the Day
Language: C++
Expertise: Beginner
Jan 19, 2000

Pointer to Structure

Question:
I have a struct:
struct mystruct
{
  DWORD dw_Id;
}*pMystruct;
In the following function I want to pass the address of 'dw_Id' which is a member of mystruct. How do I pass it?
If I am passing as-
foo(pMystruct->(&dw_Id))//compiler error

Answer:
You pass the address of a pMyStruct member like this:

foo( &pMystruct->dw_Id);
Make sure that pMyStruct points to an instance of Mystruct.
DevX Pro
 
Comment and Contribute

 

 

 

 

 


(Maximum characters: 1200). You have 1200 characters left.

 

 

Sitemap