If your struct member is a char* instead of fixed size array:
    struct boo
    {
        int x;
        char *p;
        float f;
    };


You can initialize it to point to a non-modifiable string literal:
    struct boo b = {10, "Non-Modifiable String", 10.5f};

HTH
Shyan


________________________________________
From: Ankush Agarwal [mailto:[EMAIL PROTECTED]
Sent: Saturday, October 16, 2004 3:33 AM
To: [EMAIL PROTECTED]
Subject: Re: [c-prog] Problem [struct]

Thanks Shyan and Paul,

This is working. But if the struct variable is a pointer then how should we
initialize the character array ?

Best Regards,
Ankush




To unsubscribe, send a blank message to <mailto:[EMAIL PROTECTED]>.


Yahoo! Groups Sponsor
ADVERTISEMENT
click here
Web Bug from http://us.adserver.yahoo.com/l?M=315388.5500238.6578046.3001176/D=groups/S=:HM/A=2372354/rand=937687226


Yahoo! Groups Links

Reply via email to