Solved

an easy one - How to output infinum sign

Posted on 2002-05-30
9
195 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
  • 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
 
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
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Unlike C#, C++ doesn't have native support for sealing classes (so they cannot be sub-classed). At the cost of a virtual base class pointer it is possible to implement a pseudo sealing mechanism The trick is to virtually inherit from a base class…
Many modern programming languages support the concept of a property -- a class member that combines characteristics of both a data member and a method.  These are sometimes called "smart fields" because you can add logic that is applied automaticall…
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.

863 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

20 Experts available now in Live!

Get 1:1 Help Now