Solved

Formatting Characters to Uppercase - ios::?

Posted on 1998-07-07
8
251 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
Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

 
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
 

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

Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

C++ Properties One feature missing from standard C++ that you will find in many other Object Oriented Programming languages is something called a Property (http://www.experts-exchange.com/Programming/Languages/CPP/A_3912-Object-Properties-in-C.ht…
This article shows you how to optimize memory allocations in C++ using placement new. Applicable especially to usecases dealing with creation of large number of objects. A brief on problem: Lets take example problem for simplicity: - I have a G…
The viewer will learn how to clear a vector as well as how to detect empty vectors in C++.
The viewer will be introduced to the member functions push_back and pop_back of the vector class. The video will teach the difference between the two as well as how to use each one along with its functionality.

813 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

16 Experts available now in Live!

Get 1:1 Help Now