| | |
extracting info to another array
Thread Solved
![]() |
•
•
Join Date: Mar 2007
Posts: 144
Reputation:
Solved Threads: 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??
why use two different character arrays when you can do it directly in the original, assuming the original is not string literals
C++ Syntax (Toggle Plain Text)
char str[] "hello world"; str[0] = toupper(str[0]);
Don't PM me with questions -- you might get a nasty PM in response. If you have a question then post it in one of the forums.
•
•
Join Date: Mar 2007
Posts: 144
Reputation:
Solved Threads: 0
ok so now how do I print the entire sentence.
C++ Syntax (Toggle Plain Text)
int i; for (i = 0; i < FIindex; i++) { fragments[i][0] = toupper(fragments[i][0]); std::cout << fragments << endl; }
Last edited by Ancient Dragon; Mar 4th, 2008 at 7:00 pm. Reason: correct code tags -- use /code not \code
![]() |
Other Threads in the C++ Forum
- Previous Thread: has anyone got an idea on how to change letters on the keyboard around
- Next Thread: MessageBox with OK and CancelButton
| Thread Tools | Search this Thread |
api array based binary bitmap c++ c/c++ char class classes classified code coding compatible compile console conversion count date delete deploy desktop developer directshow dll download dynamic dynamiccharacterarray email encryption error file filewrite forms fstream function functions game givemetehcodez graph gui homeworkhelp homeworkhelper homeworksolutions iamthwee icon if...else ifstream input int integer java lib linkedlist linker loop looping loops map math matrix memory multiple news node object output play pointer problem program programming project python random read recursion reference rpg string strings struct symbol temperature template test text text-file toolkit tree url values variable vector video win32 windows winsock wordfrequency wxwidgets






