Hi Shoubhik

Why cannot u try this....

#include<stdio.h>
#include<string.h>
 void main()
 {
    char *s[3] = {"000","001","010"}; // THis can be even char s[3][4] = {
"000","001","010"};
    puts(s[0]);
    puts(s[1]);
    puts(s[2]);
}

I accept that Shahansad K.P. has suggest right code.
On Sun, Feb 27, 2011 at 5:31 PM, Shahansad K.P <[email protected]> wrote:

> you have to mark the end of the string.
> try char s[3][4]={"000","001","010"};
>
>
> On 27 February 2011 17:27, Shoubhik <[email protected]> wrote:
>
>> #include<stdio.h>
>> #include<string.h>
>>
>> int main(){
>>        char s[3][3]={"000","001","010"};
>>        puts(s[0]);
>>        puts(s[1]);
>>        puts(s[2]);
>>        return 0;
>> }
>>
>> the output im expecting is:
>>
>> 000
>> 001
>> 010
>>
>>
>> instead,
>> this is the output I'm getting,
>>
>> 000001010
>> 001010
>> 010
>>
>>
>> where am i wrong ?
>>
>> I excuted the code here...    http://codepad.org/mg8mHyY7
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "google-codejam" group.
>> To post to this group, send email to [email protected].
>> To unsubscribe from this group, send email to
>> [email protected].
>> For more options, visit this group at
>> http://groups.google.com/group/google-code?hl=en.
>>
>>
> --
> You received this message because you are subscribed to the Google Groups
> "google-codejam" group.
> To post to this group, send email to [email protected].
> To unsubscribe from this group, send email to
> [email protected].
> For more options, visit this group at
> http://groups.google.com/group/google-code?hl=en.
>

-- 
You received this message because you are subscribed to the Google Groups 
"google-codejam" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/google-code?hl=en.

Reply via email to