How to make my code read in UTF-8 in C?

2

When I run this code:

#include <stdio.h>

int main(void) {
  int teste[10];
  printf("Imprimindo o vetor 'teste': %d\n", teste);
  printf("O endereço do primeiro elemento é: %d\n", teste[0]);

  return 0;
}

The letters "é" and "ç" come out with these strange symbols:

How do you get these letters to be read by the UTF-8 encoded program?

    
asked by anonymous 29.09.2017 / 16:41

1 answer

1

You can put the ASCII code directly in printf or you can add the locale.h library and add the line setlocale (LC_ALL, ""); at the beginning of the code

    
29.09.2017 / 18:40