0

I have some sentences in a 2 dimensional char array. I need to change to first letter of each sentence to caps. I was thinking of removing the first char and placing it into 1 array and the rest of the sentence into another array. run toupper on the first array and then print them both out. my question is how do I populate 1 array to the other??

2
Contributors
4
Replies
5
Views
9 Years
Discussion Span
Last Post by Ancient Dragon
0

why use two different character arrays when you can do it directly in the original, assuming the original is not string literals

char str[] "hello world";
str[0] = toupper(str[0]);
0

ok so now how do I print the entire sentence.

int i;
			
	for (i = 0; i < FIindex; i++)
	{
		fragments[i][0] = toupper(fragments[i][0]);
		std::cout << fragments << endl;
	}
This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.