?
Solved

how do i display subscript

Posted on 2008-11-02
3
Medium Priority
?
446 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 31

Expert Comment

by:Zoppo
ID: 22860844
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 1000 total points
ID: 22860848
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
ID: 22861638
Hi Infinity08,
hmmm...i'm unsure if i can use unicode. i'll check with my lecturer. Thanks for the info
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

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

When writing generic code, using template meta-programming techniques, it is sometimes useful to know if a type is convertible to another type. A good example of when this might be is if you are writing diagnostic instrumentation for code to generat…
Written by John Humphreys C++ Threading and the POSIX Library This article will cover the basic information that you need to know in order to make use of the POSIX threading library available for C and C++ on UNIX and most Linux systems.   [s…
The viewer will learn how to pass data into a function in C++. This is one step further in using functions. Instead of only printing text onto the console, the function will be able to perform calculations with argumentents given by the user.
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.
Suggested Courses

752 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