Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

RE: Help with C++ Program

Status
Not open for further replies.

Air1

Technical User
Oct 26, 2000
4
0
0
JM
How do you convert all text in a file to lowercase, capitalizing sentences. Using C or C++
 
[tab]The easiest way would be in input the file character by character. The first character of the file would be upper case (assuming that the file starts with a vailid sentence). You then convert the characters to lowers case using the standard ctype header tolower method. When you get to a period, the next character would be upper case again.

[tab]Some potential "gotcha's" would include proper names, spaces between sentences, and numbers. Look carefully at ctype for several useful methods, including isalpha, islower, toupper, tolower, isspace, etc.


James P. Cottingham

All opinions are mine alone and do not necessarily reflect those of my employer.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top