Solved

an easy one - How to output infinum sign

Posted on 2002-05-30
9
200 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
Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

 
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

Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

Question has a verified solution.

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

Suggested Solutions

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…
Introduction This article is a continuation of the C/C++ Visual Studio Express debugger series. Part 1 provided a quick start guide in using the debugger. Part 2 focused on additional topics in breakpoints. As your assignments become a little more …
The viewer will learn additional member functions of the vector class. Specifically, the capacity and swap member functions will be introduced.
The viewer will learn how to clear a vector as well as how to detect empty vectors in C++.

813 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

11 Experts available now in Live!

Get 1:1 Help Now