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 | |
|
|
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.
