User forums > Help

Ñ character error

(1/1)

plizze:

//////////////////////////////////////
//   Character Ñ failed,
//   Mistake variable, depending on the character that precedes to hex \xa4
//
//////////////////////////////////////

#include <iostream>
using namespace std;

int main()
{
std::cout<<"\n Jos\x82 "; //José
std::cout<<"\n Espa\xa4a"; //España
std::cout<<"\n Espa\xa4 a"; //Españ a
std::cout<<"\n Espa\xa4e"; //Españe
std::cout<<"\n Espa\xa4i"; //España
std::cout<<"\n Espa\xa4o"; //España
std::cout<<"\n Espa\xa4u"; //España
    return 0;
}

Jenna:
Not related to Code::Blocks and therefore violating our forum rules.

Anyway, you can insert a double-double-quote after the hex-escape-sequence, that represents the ñ.

plizze:
Thank you for the advice.

This just happens in hex. \xa4 +a or +e (works well with i, o, u)
Ñ-ñ on Decimal and Octal all works well.

My English is very basic, but I understand you:
Ex. cout<<"Espa\xa4""a"; //Works correctly
but cout<<"Espa\244a";   //in Octal it's faster to write

I hope this help other users that happens this strange error.

Navigation

[0] Message Index

Go to full version