Do you need to use a pointer in the maiN structure? If you don't, your
program becomes simpler:

#include <stdio.h>
#include <string.h>

struct sub {
    char name[100];
};


struct maiN {
    struct sub s1;
    int c;
};


int main(void)
{
    struct maiN s0;

    s0.c = 42;
    strcpy(s0.s1.name,"hi man ");

    printf("name: %s\nvalue: %d\n", s0.s1.name, s0.c);

    return 0;
}


Reply via email to