pinkpanther
pinkpanther

Reputation: 4808

How to store french characters in c++

I've been trying it for an hour searched everything.

I tried using this wchar_t c=L'é'; it didn't work.

It gave me an Invalid argument at that line in dev-cpp When I ran this directly with g++ in cmd I got error: converting to execution character set: Invalid argument How can we solve this?

EDIT

Code:

#include<string.h>
#include<iostream>
using namespace std;
int main() {
  setlocale(LC_CTYPE, "");
  wchar_t ccc=L'é';
  wchar_t ar[]=L"é";
  wchar_t bf[]=L"a";
  wchar_t cd;
}

EDIT Dev-C++ compiler, Windows-7

Upvotes: 0

Views: 1186

Answers (1)

pinkpanther
pinkpanther

Reputation: 4808

Well, the problem solved by the comment by Hans Passant

There may be many reasons for this problem as pointed in comments. But the problem for me is solved by changing the editor. I was using Dev-cpp and probably that caused the problem. I used Geany and got it compiled successfully. But Dev-cpp was bitter with me in this instance.

For future visitors: Editor could be a problem if you encounter the problem stated in the question.

Upvotes: 1

Related Questions