You need to test for the current location in your string, not c.
Code:
if ((j = isspace(name[i])) == -1)
And delete the
int isspace(int c); definition inside your main() function, it has no use, since including ctype.h will already do that.
Perhaps you even want to turn the whole situation around with something like:
Code:
for( i = 0; i < strlen( name ) - 1; ++i )
if (isalpha(name[i]) || isdigit(name[i]))
name[i] = name[i] + 1;
So it's only alphanumeric charactors that are beeing transformed.
Or perhaps even, stop relying on a system provided function and hardcode it yourself, like:
Code:
for( i = 0; i < strlen( name ) - 1; ++i )
if ((name[i] >= 'a' && name[i] <= 'z') || (name[i] >= 'A' && name[i] <= 'Z'))
name[i] = name[i] + 1;