Solved

Formatting Characters to Uppercase - ios::?

Posted on 1998-07-07
8
227 Views
Last Modified: 2010-04-01
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*.  ;)

Jim
0
Comment
Question by:jnowlin
  • 4
  • 2
  • 2
8 Comments
 

Expert Comment

by:kashif063098
ID: 1167353
Why don't you use towupper() ?
what about if i tell you win32 api function would it work for you ?



0
 
LVL 2

Accepted Solution

by:
VEngineer earned 50 total points
ID: 1167354
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.
0
 

Expert Comment

by:kashif063098
ID: 1167355
YOU CAN USES WIN32 API FUNCTION 'CHARUPPER()' TO CONVERT CHARS FROM LOWER CASE TO UPPER CASE
give a try


0
 
LVL 2

Expert Comment

by:VEngineer
ID: 1167356
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
0
Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

 

Author Comment

by:jnowlin
ID: 1167357
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
0
 
LVL 2

Expert Comment

by:VEngineer
ID: 1167358

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 uva_swinger@yahoo.com

Earlier you asked about a good C++ book.. Let me strongly suggest Cohoon and Davidson's "C++ Program Design"  
0
 

Author Comment

by:jnowlin
ID: 1167359
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?
Jim
0
 
LVL 2

Expert Comment

by:VEngineer
ID: 1167360
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.
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Introduction This article is the first in a series of articles about the C/C++ Visual Studio Express debugger.  It provides a quick start guide in using the debugger. Part 2 focuses on additional topics in breakpoints.  Lastly, Part 3 focuses on th…
Basic understanding on "OO- Object Orientation" is needed for designing a logical solution to solve a problem. Basic OOAD is a prerequisite for a coder to ensure that they follow the basic design of OO. This would help developers to understand the b…
The goal of the tutorial is to teach the user how to use functions in C++. The video will cover how to define functions, how to call functions and how to create functions prototypes. Microsoft Visual C++ 2010 Express will be used as a text editor an…
The viewer will learn how to user default arguments when defining functions. This method of defining functions will be contrasted with the non-default-argument of defining functions.

708 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now