Euro symbol

So, I'm doing a basic USD to Euro converter for my class, and its all easy-peasy so I'm adding a little bit of flair. How do I put the Euro symbol in for a console app?
Last edited on
Depends on the character map the console is using. You could use "EUR", which is standard and will work everywhere.
How would i put that in the code to make it turn "20.00" into "$20.00" (except using the euro symbol)? I've never worked with unicode or ISO codes or whatever... here is what I have

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
/* 
   USDToEuroConversion.cpp : main project file.
   Prgmd by: me mah fuh
   10/28/09
*/

#include "stdafx.h"
#include <iostream>

using namespace System;

int main(array<System::String ^> ^args)
{
        double USD = 0;
	double Euros = 0;
	const double Rate = .8676;
	std::cout<<"Welcome to Suck It bank of the Swiss - How may I help you?\n";
	std::cout<<"-----------------------------\n";
	std::cout<<"How many $'s do you have?\n";
	std::cout<<"$";
	std::cin>> USD;
	std::cout<<"-----------------------------\n";
	Euros = USD * Rate; //conversion
	std::cout<<"you have " << Euros << " Euros.\n";
    system("pause");
	return 0;
}


so pretty basic you see
Last edited on
€ is not an ASCII ( 0-127 ) character. If your console doesn't support such character it would be hard for you doing so.
BTW, if you want good marks, I would avoid all the bitty-kiddie talk and I would come up with a better bank name than "Suck It".

Also, "EUR 20.00" really is your best choice. Trying to do it any other way is surprisingly complex and perplexing, even to veteran programmers who have to deal with the nonsense necessary to make it happen.

If you know for sure your professor will be using Windows, you can play with the Console Code Page.

If you know for sure your professor will be using Linux, you could output the UTF-8 code sequence and it will most likely work (but that is not guaranteed). IIRC: cout << "\xE2\x82\xAC";, translated in my head just now.

Good luck!
Last edited on
Topic archived. No new replies allowed.