Solved

an easy one - How to output infinum sign

Posted on 2002-05-30
9
207 Views
Last Modified: 2010-04-02
How can I output, with cout, an infinum sign from ASCII table (num. 236) in MS Visual C++ / console application?

I was playing around with char(236), but no luck.. A different character table maybe?

TNX!

Jurij
0
Comment
Question by:jurij
[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
  • 2
  • 2
  • 2
  • +3
9 Comments
 
LVL 32

Expert Comment

by:jhance
ID: 7044766
How about:

     char inf = 236;
     cout << inf << endl;

??
0
 

Author Comment

by:jurij
ID: 7045121
That's the same as using:
 cout << char(236) << endl;
and it does not work! I don't get an infinum sign.
I think problem is in the char table I'm using.. no infinum sign..
TNX anyway...
0
 
LVL 32

Expert Comment

by:jhance
ID: 7045226
I tried it myself and I got a infinity sign in the CMD window, just as you asked....
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 49

Accepted Solution

by:
DanRollins earned 200 total points
ID: 7045361
You may need to select a different default font for your console window.  This is done by clicking the icon in the top left corner and chosing properties.

-- Dan
0
 
LVL 1

Expert Comment

by:Shivshankar
ID: 7048442
Try printing "\236"... i.e. cout << "\236"
0
 
LVL 6

Expert Comment

by:Triskelion
ID: 7049921
One way to ensure your FONT or character set has the sign is to type it manually at the command prompt.

Hold down ALT, type 236 [ON THE KEYPAD only], release the ALT.  If it is some unexpected character, then DanRollins has it pegged.

If it works, try this code; it should also work.

#include <iostream>
using namespace std;

void main(void)
{
     printf("ì %c \xEC\n", 236);
     cout << "ì " << char(236) << " \xEC" << endl;
}
0
 

Author Comment

by:jurij
ID: 7051478
That's the problem!
I have a different character set (no infinum sign).
Can I "override" or re-set a different character set in my c++ program?
Thank you!
0
 
LVL 49

Expert Comment

by:DanRollins
ID: 7052225
In the Windows Explorer, right-click on your EXE and drag and rop it, choosing "Create Shortcut here"  Then right-click that and choose Properties and then set the font.

Or run the app, right-click the top-left corner, set properties set the font and indicate "Save properties for future windows with the same title"

There may be a way to set font for a console window programatically, but you probably only need that for a commerical product.  

-- Dan
0
 
LVL 11

Expert Comment

by:griessh
ID: 7260220
Dear jurii

I think you forgot this question. I will ask Community Support to close it unless you finalize it within 7 days. You can always request to keep this question open. But remember, experts can only help you if you provide feedback to their questions.
Unless there is objection or further activity,  I will suggest to accept

     "DanRollins"

comment(s) as an answer.

PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!
======
Werner
0

Featured Post

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

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

Often, when implementing a feature, you won't know how certain events should be handled at the point where they occur and you'd rather defer to the user of your function or class. For example, a XML parser will extract a tag from the source code, wh…
This article will show you some of the more useful Standard Template Library (STL) algorithms through the use of working examples.  You will learn about how these algorithms fit into the STL architecture, how they work with STL containers, and why t…
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 be introduced to the technique of using vectors in C++. The video will cover how to define a vector, store values in the vector and retrieve data from the values stored in the vector.

624 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