@ Gaurav: in ASCII code : '\0' is actually 0, if you are confused with '0' and 0, first one the character and later one is Remember that '0' is not 0 in ASCII, rather value of '0' is 48.
So they can be used in place of each other. [ Just expanding what Sagar is trying to say] On 14 August 2011 14:32, sagar pareek <[email protected]> wrote: > arshad > u got my point or not? > > > On Sun, Aug 14, 2011 at 1:16 PM, Arshad Alam <[email protected]> wrote: > >> program is running smooth but I have one confusion at line number 8. >> why it is *while(s[i]!=0)* instead of *while(s[i]!='\0')* >> >> >> >> 1. #include<stdio.h> >> 2. #include<conio.h> >> 3. void main() >> 4. { >> 5. clrscr(); >> 6. char s[]="No two viruses"; >> 7. int i=0; >> 8. while(s[i]!=0) >> 9. { >> 10. printf("\n%c %c",s[i],*(s+i)); >> 11. printf ( "\n%c %c",i[s],*(i+s)); >> 12. i++; >> 13. } >> 14. getch(); >> 15. } >> >> >> >> >> Thanks & Regards >> Arshad Nadeem Alam >> >> >> -- >> You received this message because you are subscribed to the Google Groups >> "Algorithm Geeks" 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/algogeeks?hl=en. >> > > > > -- > **Regards > SAGAR PAREEK > COMPUTER SCIENCE AND ENGINEERING > NIT ALLAHABAD > > -- > You received this message because you are subscribed to the Google Groups > "Algorithm Geeks" 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/algogeeks?hl=en. > -- ___________________________________________________________________________________________________________ Please do not print this e-mail until urgent requirement. Go Green!! Save Papers <=> Save Trees -- You received this message because you are subscribed to the Google Groups "Algorithm Geeks" 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/algogeeks?hl=en.
