On 6/16/07, rahul chaudhary <[EMAIL PROTECTED]> wrote:
>
>
>
> ranjan kumar ojha <[EMAIL PROTECTED] <cool_ranjan4all%40yahoo.com>>
> wrote: #include<cstdio>
> int main()
> {
> char *s="\12345s\n";
> print("%d",sizeof(s));
> return 0;
> }
>
> what will be output of above program and why ????
>
>
> hi friend,
> your program will give error because you declare a pointer as trying to
> assign a value to a pointer at the declaration time.
> its not valid and acceptable in C
>
>
>
> Recent Activity
>
> - 60
> New
> Members<http://groups.yahoo.com/group/c-prog/members;_ylc=X3oDMTJmcHJqczZzBF9TAzk3MzU5NzE0BGdycElkAzEwMTMxMzkEZ3Jwc3BJZAMxNzA1MDA2Nzg4BHNlYwN2dGwEc2xrA3ZtYnJzBHN0aW1lAzExODIwMTgwNTQ->
>
> Visit Your Group
> <http://groups.yahoo.com/group/c-prog;_ylc=X3oDMTJlM2wxcW5jBF9TAzk3MzU5NzE0BGdycElkAzEwMTMxMzkEZ3Jwc3BJZAMxNzA1MDA2Nzg4BHNlYwN2dGwEc2xrA3ZnaHAEc3RpbWUDMTE4MjAxODA1NA-->
> SPONSORED LINKS
>
>
>
> .
>
No, thats not the cause of error.
We can initialize a char pointer with a constant string.
It is valid and acceptable in C.
Dipak
[Non-text portions of this message have been removed]