Passing a string to and from a function.
I am having a problem passing a string to a function and back up to main. I know there is a problem with where I have the pointers but I've played with it for a while and i cant seem to get it working...
Any ideas?
Thanks..
Code:
#include <stdio.h>
#include <ctype.h>
#include <string.h>
main()
{
void convert (char *ch1[]);
char str[10];
printf("Enter a word: ");
gets(str);
convert (&str);
printf("Converted to: %s",&str);
}
void convert (char *ch1[])
{
char ch = ch1;
ch= toupper(ch1);
return ch;
}