I get segmentation fault whenever i try to run this. Have no idea why. The logic seems to be correct, its probably something with function calls. Debugger says something about stack but i have no idea how to interpretate this.
char* rev_string(char* t)
{
int i;
int j;
i = j = 0;
char tmp;
while(t[i] != '\0')
i++;
while(i > j)
{
tmp = t[i];
t[i] = t[j];
t[j] = tmp;
i--;
j++;
}
return t;
}