Hi all
I have to write a program that will split a person's name by first and last...so for example one enters JoeWalsh and the output is Joe Walsh. For our purposes we can assume the first letter is capitilized and there is only one other signifying the beginning of the person's last name. I think I am pretty close...the code I have now gives me Joe alsh, when I enter in the JoeWalsh...I know I just can't figure out to get something like ' '&input[i](meaning the space and input[i] are cancatenated some how) during the if function. Any help is greatly appreciated.
Code:void split(char input[]) { int i; //int j; i=0; j=0; for (i=1;input[i] != 0;i++) { if (input[i] >= 'A' && input[i] <= 'Z') { input[i] = ' '; //input[j] = input[i]; // j++; } } } int main() { char output[80]; printf("Enter any string->"); scanf("%s",output); split (output); //char ret; //ret = devowel(input); printf("split %s\n", output); return 0; }