On Sun, Nov 23, 2008 at 4:48 AM, Ahmed Shabana <[EMAIL PROTECTED]> wrote:
> #include<stdio.h>
> #include<string.h>
>
>
> struct sub {
>        char name[100];
> };
>
>
> struct maiN {
>        struct sub *s1;
>        int c;
> };

sub *s1 is a pointer inside maiN

>
> int main()
> {
>
>        struct maiN s0;
>        strcpy(s0.s1->name,"hi man ");

You create an instance of maiN but s1 has not been initialized (need
to allocate memory for it). You try to write data into s1 but you're
not allowed to yet.

-- Brett
------------------------------------------------------------
"In the rhythm of music a secret is hidden;
    If I were to divulge it, it would overturn the world."
               -- Jelaleddin Rumi

Reply via email to