on first iteration *ptr == 'h' so it will enter in the loop. ptr++ --> *ptr == 'e'; comparing *ptr with least i.e 127 (ascii) *ptr will be 'e' now; 2nd iteration *ptr == e ptr++ -> *ptr = 'l' comparing 'e' with 'l' and 'e' will be assgined to least and so on;
coz 'e' has the lowest ascii value in given set of characters so least will never change when first time it is assgined to 'e'; -- Anshuman Mishra | Software Development Engineer | Amazon -- You received this message because you are subscribed to the Google Groups "Algorithm Geeks" group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en.