I've been looking around for a solution to this, but haven't quite found one.
I've got a function which do some string manipulation (simplified):
void plr(char str, char *stro){
strcpy(*stro, str);
}
My issue lies in the fact that I cannot get my result out from the function:
int main(void){
//string and string out.
char str[25], stro[25];
printf("Something please: ");
scanf("%s", &str);
plr(str, &stro); // So basically stro would be the same as str.
printf("Copy succesfull, %s", stro);
return 0;
}
The whole idea is that I have the function pluralis, which would append pluralis to the string given and output it to stro. The whole string manipulation has been tested and works, if it's inside the main(), but I simply cannot get it to work with a function and the pointer. I could obviously leave it be, but what would I learn from that.
Is there something I need to consider when it's an array I point to, rather than a normal value of sorts.
Edit: Thanks for all the help, it has been solved. Greatly appreciated all!