http://codepad.org/OpqOhxkZ
this could be a sample code to test call by ref... On Feb 27, 5:15 pm, Shoubhik <sbos...@gmail.com> wrote: > http://codepad.org/U6XDKsV5 > > check out the code plz.. I'm getting garbage ! > > On Feb 27, 5:14 pm, Shoubhik <sbos...@gmail.com> wrote: > > > > > > > yeah.. i got it, I was expecting it to be taken as default ( I feel so > > silly :) ) > > > On Feb 27, 5:12 pm, "Shahansad K.P" <shahan...@gmail.com> wrote: > > > > 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 <sbos...@gmail.com> wrote: > > > > > THanks it worked ! :) > > > > > On Feb 27, 5:01 pm, "Shahansad K.P" <shahan...@gmail.com> 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 <sbos...@gmail.com> 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 google-code@googlegroups.com. > > > > > > To unsubscribe from this group, send email to > > > > > > google-code+unsubscr...@googlegroups.com. > > > > > > 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 google-code@googlegroups.com. > > > > To unsubscribe from this group, send email to > > > > google-code+unsubscr...@googlegroups.com. > > > > 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 google-code@googlegroups.com. To unsubscribe from this group, send email to google-code+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/google-code?hl=en.