#cat test.c
#include <unistd.h>
typedef struct {int data ; int counter;}rec;
typedef struct node {rec s1;struct node *next ;}node1;
typedef node1 *nodeptr; /*nodeptr should be typedef'd
*/
int main()
{
int i;
nodeptr a[10]; /* a[] should be defined here */
for(i=0;i<10;i++)
a[i]=NULL;
for(i=0;i<10;i++)
a[i] = (nodeptr)malloc(sizeof(node1));
for(i=0;i<10;i++)
a[0]->s1.counter=0;
}
--Chandan
--- ss dos <[EMAIL PROTECTED]> wrote:
> i wrote this code .....
>
> typedef struct {int data ; int counter;}rec;
> typedef struct node {rec s1;struct node *next
> ;}node1;
> node1 *nodeptr;
>
>
> int main()
> {
> nodeptr[10];
> for(i=0;i<10;i++)
> a[i]=NULL;
>
>
> a[0]->s1.counter=0; // here the error and the
> error is
> dereferencing pointer to incomplete type??? what
> does it mean ???
>
>
> __________________________________________________
> Do You Yahoo!?
> Tired of spam? Yahoo! Mail has the best spam
> protection around
> http://mail.yahoo.com
__________________________________
Do you Yahoo!?
Check out the new Yahoo! Front Page.
www.yahoo.com
To unsubscribe, send a blank message to <mailto:[EMAIL PROTECTED]>.
| Yahoo! Groups Sponsor | |
|
|
Yahoo! Groups Links
- To visit your group on the web, go to:
http://groups.yahoo.com/group/c-prog/
- To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]
- Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.
