Is there a way to check if the compiler generates equivalent code for iteration using pointers and iteration using indexing???
i.e. for the codes
void f1(char v[])
{
for(int i=0; v[i]!=0;i++) use(v[i]);
}
and
void f1(char v[])
{
for(char *p = v; *p!=0; p++) use(*p);
}
I use microsoft visual C++ as my compiler……
Please help…..
1 Answer