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??

Recommended Answers

All 4 Replies

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]);

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;
	}

go it working.

thanks

>>std::cout << fragments << endl;

should be this:
std::cout << fragments << endl;

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.