Jump to content

help wid a pointers issue!!

- - - - -

This topic has been archived. This means that you cannot reply to this topic.
2 replies to this topic

#1
cribtolearn

cribtolearn

    Newbie

  • Members
  • Pip
  • 9 posts
struct node
{

    int a,b,c;
    float d;
} *p2;

p2 = new node;
here pls tell me of having p2 after the node definition??

Edited by WingedPanther, 29 May 2008 - 10:50 AM.
add code tags


#2
MeTh0Dz

MeTh0Dz

    Writes binary right handed and hex left handed

  • Members
  • PipPipPipPipPipPipPipPipPip
  • 2,119 posts
Okay you can of have the wrong idea..... This is the two ways that you can do what you are trying to do.
typedef struct node {
int a,b,c;
float d;
} p2, *p2;

p2* your_struct_pointer;
p2 your_struct;
Or....
struct node {
int a,b,c;
float d;
};

node* your_struct_pointer;
node your_struct;
O... And just so you know it's kinda early so I might have messed something up in that, but you should get the general idea....

Edited by WingedPanther, 29 May 2008 - 10:51 AM.
add code tags


#3
cribtolearn

cribtolearn

    Newbie

  • Members
  • Pip
  • 9 posts
ok got it thanks a lot!!