I cannot use accents in Code Blocks

Asked

Viewed 4,341 times

1

Hello! I have a code:

include stdio.h>
include locale.h>

int main()
{
setlocale(LC_ALL,"portuguese");
printf("Agora não tem mais problema algum para utilizar acentuação!\n");
return 0;
}

Set to right... But does not return with the proper accented characters. If I use DEV C++ it is right.

I set up GNC CC Compiler at the beginning.

  • And what is the coding configuration of the Codeblocks editor?

  • strange, I think he’s not compiling with the flag responsibly so try setala manualmete

  • 1

    A encoding in Codeblocks appears in Settings > Editor > Encoding Settings

  • Your Windows is in English?

3 answers

2

Test this way without putting Portuguese.

#include <stdio.h>
#include <locale.h>

int main()
{
setlocale(LC_ALL,"");
printf("Agora não tem mais problema algum para utilizar acentuação!\n");
return 0;
}

teste

  • I’ve tried it this way and it didn’t work either.

1

#include <locale.h>

int main(void){

 setlocale (LC_ALL, "Portuguese_Brazil");

return 0;
}

-1

Those includes so without # and without the <sign, should be:

#include <stdio.h>
#include <locale.h>

Browser other questions tagged

You are not signed in. Login or sign up in order to post.