Formatting Characters to Uppercase - ios::?

What part of <iostream.h>'s ios class (if that's where it resides) will allow me to convert characters read from
an ordinary text file to all uppercase? I've seemingly searched everywhere(I'm sure
it exists *somewhere*.  ;)

Who is Participating?

[Webinar] Streamline your web hosting managementRegister Today

VEngineerConnect With a Mentor Commented:
If you are trying to do non-windows programming:

The function toupper is part of the standard library, but is not part of iostream class.  I believe it is part of another library.. ctype.h.  I'll check and get back to you on this.
Why don't you use towupper() ?
what about if i tell you win32 api function would it work for you ?

give a try

The new generation of project management tools

With’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

If you are using an older implementation, it will be in stdlib.h
If you plan on using the new standard library, it will be in ctype.h

In Visual C++, the function is int toupper(int ch)
In Borland, I think it is called int to_upper(int ch)

Although it says int in the header, you can use chars since they are based off of ints.

If you are doing win32 api or mfc programming, kashif's suggestion will work better
jnowlinAuthor Commented:
Thanks VEngineer and kashif,
I thought that that might of been the function but I was trying to think in terms
of C++ objects and a standard library function, much the same as ios::toupper().
I'm trying to learn C++ in DOS for the time being so it looks like my Borland
Turbo C++ 3.0 will have this in <ctype.h>

Jim Nowlin

It appears you are learning C++.  I tutor for several C++ courses and if you have any questions, feel free to e-mail me at

Earlier you asked about a good C++ book.. Let me strongly suggest Cohoon and Davidson's "C++ Program Design"  
jnowlinAuthor Commented:
Yeah, that's me, learning C++. Thanks for the Email address, I may take you up
on the offer. I have so many C++ books but I don't have Cohoon and Davidson's
(I don't think so, anyway). Does it come with code on CD?
Cohoon and Davidson comes with a disk with the code on it.  The only problem I foresee is that the graphics programming (one or two chapters) requires a more recent compiler.  If you already have enough good books, I say stick with those for a while.

The good thing about Cohoon and Davidson is that they really stress design and they explain _why_ things work, not just _how_ to do it or give a long explaination that is difficult to understand.  The style is good and it doesn't move too slow either.  It is C++ from the ground up, not C converted to C++ (like Walter Savitch's book), so they teach new design techniques, tailored for the beginning C++ programmer, specific for the language with classic examples that you have probably seen in other programming languages.  If you get a chance, order it at your local bookstore, take a look at it, and if you are interested, then buy it.  This book presents a new approach to learning C++ and software engineeering and I think there is a reason that over 150 institutions use Cohoon and Davidson as their primary text.

I remember how frustrating it is finding a good book for beginners... most people out here will recommend Lippman or Stroustrop, but those books were very difficult for me to use as a beginner.  Deitel and Deitel is not bad and is frequently reccommended, but I don't like several portions of their approach.

Good luck with your learning.
All Courses

From novice to tech pro — start learning today.