简体   繁体   中英

How to produce Euro symbol in C?

Please give me a sample C program to produce the euro sysmbol. I'm using windows keyboard and program needs to be compiled in linux.

Update: Actually I need Euro symbol as a string and need to concatenate it with amount string.

I'm having Dell Latitude D620 laptop and tried using Alt+4, Alt+5, etc.. None of them prints the euro sysmbol.

This is entirely character encoding specific.

This question should sum up why there is no straight answer to your question:

Hex representation of Euro Symbol €

The Unicode standard code-point for the Euro sign (€) is U+20AC.

If your system is running using UTF-8 as its native encoding, you can represent this glyph using the string "\\xE2\\x82\\xAC" . The encoding uses three bytes to represent the 16-bit value of the code-point.

Use "\€" ; this is UTF-8 encoding of Euro sign. More info here .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM