Solved

how do i display subscript

Posted on 2008-11-02
3
440 Views
Last Modified: 2012-05-05
i want to cout << "X1, Y1, Z1";
Due to the system I cannot display the desired result. All the 1s beside X,Y and Z are subscripts.

How do i do this in c++?
0
Comment
Question by:dandeliondream
3 Comments
 
LVL 30

Expert Comment

by:Zoppo
Comment Utility
Hi dandeliondream,

what do you mean with 'subscripts'? Do you mean these three are arrays? If so you can output them like this:

cout << X[1] << ", " << Y[1] << ", " << Z[1];

Hope that helps,

ZOPPO
0
 
LVL 53

Accepted Solution

by:
Infinity08 earned 250 total points
Comment Utility
The (extended) ASCII table doesn't have any subscript characters.

Unicode does though (subscript 1 is U+2081 for example) :

        http://www.unicode.org/charts/PDF/U2070.pdf

Can you use Unicode ?
0
 
LVL 3

Author Comment

by:dandeliondream
Comment Utility
Hi Infinity08,
hmmm...i'm unsure if i can use unicode. i'll check with my lecturer. Thanks for the info
0

Featured Post

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

Suggested Solutions

In days of old, returning something by value from a function in C++ was necessarily avoided because it would, invariably, involve one or even two copies of the object being created and potentially costly calls to a copy-constructor and destructor. A…
IntroductionThis article is the second in a three part article series on the Visual Studio 2008 Debugger.  It provides tips in setting and using breakpoints. If not familiar with this debugger, you can find a basic introduction in the EE article loc…
The goal of the video will be to teach the user the concept of local variables and scope. An example of a locally defined variable will be given as well as an explanation of what scope is in C++. The local variable and concept of scope will be relat…
The viewer will learn how to use the return statement in functions in C++. The video will also teach the user how to pass data to a function and have the function return data back for further processing.

762 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

10 Experts available now in Live!

Get 1:1 Help Now