enter string: the quick brown fox and the lazy dog.
enter string to delete: the(the first one)
new string: quick brown fox and the lazy dog.
[QUOTE=Iam3R;1131434][CODE] char str="the quick brown fox and the lazy dog" ; int i =0; while(str[i] !=' ' ) i++; strcpy(str,str+i+1); [/CODE] works if the above is your requirement, analyze it yourself. happy learning...........[/QUOTE] Spot the undefined behavior in the above code. Happy learning! ;) Read More
[CODE]strcpy(str,str+i+1);[/CODE] [QUOTE]The strcpy function copies the string pointed to by s2 (including the terminating null character) into the array pointed to by s1. [COLOR="Red"]If copying takes place between objects that overlap, the behavior is undefined.[/COLOR][/QUOTE] Read More
Edited by Dave Sinkula: Added emoticon.
Edited by Dave Sinkula: n/a