| | |
extracting info to another array
Please support our C++ advertiser: Intel Parallel Studio Home
Thread Solved |
•
•
Join Date: Mar 2007
Posts: 154
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: 154
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 beginner binary c++ c/c++ calculator char char* class classes code compile compiler console conversion count delete deploy desktop directshow dll download dynamic dynamiccharacterarray email encryption error file forms fstream function functions game givemetehcodez google graph gui homeworkhelp homeworkhelper iamthwee ifstream input int integer java lib linkedlist linker linux list loop looping loops map math matrix memory news node numbertoword output parameter pointer problem program programming project python random read recursion recursive reference return rpg sorting string strings struct temperature template templates test text text-file tree unix url variable vector video visualstudio win32 windows winsock word wordfrequency wxwidgets






