Hi! This is my code:
Code:
...
char tmpchar[255];
...
printf("Enter the filename: ");
fgets(tmpchar,MAXFILES,stdin);
strcpy(tmpchar,ws2_());
printf("%s\n",tmpchar);
....
And this is my WhiteSpace2_ function:
Code:
char *ws2_(void) {
char *ws2_tmpchar[255];
int i;
for(i = 0;i<=strlen(tmpchar);i++)
{
if(strcmp(tmpchar[i]," ") == 0)
strcat(ws2_tmpchar[i],"_");
else
strcat(ws2_tmpchar[i],tmpchar[i]);
}
return ws2_tmpchar;
Ok, afaik this should work. But it doesn't and gcc gives me warnings:
cast to pointer from integer of different size
passing arg 1 of 'strcmp' makes pointer from integer without a cast
return from incompatible pointer type
Thats not good . First: Why does tmpchar[i] does not work ? And why is the returning of ws2_tmpchar incompatible ?
Thx for attention, Demonus