[algogeeks] Re: use of ^ in char[]

2011-08-30 Thread shiva
ya i got it... thanks... On Aug 25, 9:43 pm, sukran dhawan wrote: > i got stack smashing run time erroer > > > > > > > > On Wed, Aug 24, 2011 at 11:24 AM, Md.Khalid Ahmad wrote: > > Since you are accessing array out of bound. > > there will be runtime error of stack corruption. > > > On Aug 23,

Re: [algogeeks] Re: use of ^ in char[]

2011-08-25 Thread sukran dhawan
i got stack smashing run time erroer On Wed, Aug 24, 2011 at 11:24 AM, Md.Khalid Ahmad wrote: > Since you are accessing array out of bound. > there will be runtime error of stack corruption. > > On Aug 23, 7:40 pm, shiva wrote: > > #include > > int main(){ > > char str[]="abcd"; > > int

[algogeeks] Re: use of ^ in char[]

2011-08-25 Thread Md.Khalid Ahmad
Since you are accessing array out of bound. there will be runtime error of stack corruption. On Aug 23, 7:40 pm, shiva wrote: > #include > int main(){ >     char str[]="abcd"; >     int i; > >     for(i=0;i<6;i++){ >             str[i]^=str[6-i]; >             } >             printf("\n%s",str);

[algogeeks] Re: use of ^ in char[]

2011-08-23 Thread Dave
@Shiva: Notice that str is an array of length 5 (abcd and the null character), but when i = 0, you are referencing a[6] and when i = 1 you are referencing a[5], both of which are outside the array. Dave On Aug 23, 12:35 pm, shiva wrote: > ya tat's 4 nos. but tat doesn't seem 2 b workin for char.

[algogeeks] Re: use of ^ in char[]

2011-08-23 Thread shiva
ya tat's 4 nos. but tat doesn't seem 2 b workin for char... chk it out with an example... On Aug 23, 10:28 pm, nagarajan wrote: > You are doing Bitwise XOR > > and getting values corresponding symbols of XOR -ed result.. > > > > > > > > > > On Tue, Aug 23, 2011 at 8:10 PM, shiva wrote: > >