The thing is is that there should be a null character  '\0' at the end of
any string.
The takeaway is that for a string of n length you have to allocate n+1
length array.

On 27 February 2011 17:37, Shoubhik <[email protected]> wrote:

> THanks it worked !  :)
>
>
>
> On Feb 27, 5:01 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