Welcome to Dream.In.Code
Become a C++ Expert!

Join 149,844 C++ Programmers for FREE! Get instant access to thousands of C++ experts, tutorials, code snippets, and more! There are 2,355 people online right now. Registration is fast and FREE... Join Now!




pointer to pointer to struct in C (1L)

 
Reply to this topicStart new topic

pointer to pointer to struct in C (1L)

nano72
22 Feb, 2007 - 06:58 AM
Post #1

New D.I.C Head
*

Joined: 6 Sep, 2006
Posts: 19


My Contributions
Hi,

Does anyone know another way one could pass a pointer to a pointer to a struct eg. have the following scenario:
CODE

fn (args+1L)
struct car{
};
void fn ( car *carstrPtr){
}

thanks inadvance ,

This post has been edited by Dark_Nexus: 22 Feb, 2007 - 09:22 AM
User is offlineProfile CardPM
+Quote Post

NickDMax
RE: Pointer To Pointer To Struct In C (1L)
24 Feb, 2007 - 04:34 PM
Post #2

2B||!2B
Group Icon

Joined: 18 Feb, 2007
Posts: 2,869



Thanked: 53 times
Dream Kudos: 550
My Contributions
to pass a pointer, to a pointer, to a structure. do you mean like
CODE
void assign(double **dpp);

int main()
{
  double dbl;  //var
  double *p2dbl; //Pointer to var
  dbl = 0;
  p2dbl = &dbl;
  assign(&p2sbl);
  cout << "dbl: " << dbl << " *p2dbl: " << *p2dbl << "\n";
}
void assign (double **dpp)
{
     **dpp = 0.1;
     return;
}

User is offlineProfile CardPM
+Quote Post

Reply to this topicStart new topic
Time is now: 1/8/09 10:12AM

Be Social

Dream.In.Code RSS Feed Dream.In.Code LinkedIn Group Follow Us On Twitter

Live C++ Help!

C++ Tutorials

Reference Sheets

C++ Snippets

DIC Chatroom

Bye Bye Ads

Monthly Drawing

Thumb Drive

Top Contributors

Top 10 Kudos This Month