I have these two pointers, amen and ptr, where all the values i assign to amen will also be assigned to ptr.
Can ptr and amen be aliases?
void func(const char *ptr)
{
struct samp *test;
DIR *dp;
char *amen;
if(ptr[0]=='c'||ptr[0]=='C')
strcpy(amen,"c_amen.txt");
else if()
......
else
...
}
so if func is called as func("C");, ptr will have the same vale as amen immediately after line 4.
Plus, what is const for? Shouldn't it be to protect ptr from being changed inside func?