consider the following two code:
void PrintLetter(char *src)
{
while(*src != '\0')
{
printf("%c",*src);
src++;
}
}
and
void PrintLetter(char *src)
{
int i;
for(i=0;src[i];i++)
printf("%c",src[i]);
}
Is there any performance difference between the two?
None whatsoever. The compiler will perform its optimizations regardless of the form you are writing. The underlying assembly code is the same.