The pointer keeps incrementing and never returns to the beginning of the array. When you use indexing, the loop always starts from the beginning of the array. The code where you use pointer starts always from the point where it left the last time.
Leave optimization to the compiler. Usually when a programmer starts "optimizing" his code, he actually makes it worse. Writing good readable code produces much better results most of the time. Modern compilers are very good at optimizing code...
Leave optimization to the compiler. Usually when a programmer starts "optimizing" his code, he actually makes it worse. Writing good readable code produces much better results most of the time. Modern compilers are very good at optimizing code...
char *temp; // Temporary pointer that we will use inside the loop.
temp = c; // Set the pointer at the beginning
for(char t=0;t<5;t++) {
ch=*temp++; // Increment the pointer and get the character from that position
HSerout(ch); //sending back the data
}