Solved

an easy one - How to output infinum sign

Posted on 2002-05-30
9
193 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
Comment Utility
How about:

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

??
0
 

Author Comment

by:jurij
Comment Utility
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
Comment Utility
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
Comment Utility
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
What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

 
LVL 1

Expert Comment

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

Expert Comment

by:Triskelion
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
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

Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Article by: SunnyDark
This article's goal is to present you with an easy to use XML wrapper for C++ and also present some interesting techniques that you might use with MS C++. The reason I built this class is to ease the pain of using XML files with C++, since there is…
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 tutorial is to teach the user how to use functions in C++. The video will cover how to define functions, how to call functions and how to create functions prototypes. Microsoft Visual C++ 2010 Express will be used as a text editor an…
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…

763 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