I'm having a trouble with GCC compiler and Windows CMD because I can't see the UTF-8 characters correctly. I've the following code:
#include <stdio.h>
#include <stdlib.h>
int main()
{
char caractere;
int inteiro;
float Float;
double Double;
printf("Tipo de Dados\tNúmero de Bytes\tEndereço\n");
printf("Caractere\t%d bytes \t em %d\n", sizeof(caractere), &caractere);
printf("Inteiro\t%d bytes \t em %d\n", sizeof(inteiro), &inteiro);
printf("Float\t%d bytes \t\t em %d\n", sizeof(Float), &Float);
printf("Double\t%d bytes \t em %d\n", sizeof(Double), &Double);
printf("Caractere: %d bytes \t em %p\n", sizeof(caractere), &caractere);
printf("Inteiro: %d bytes \t em %p\n", sizeof(inteiro), &inteiro);
printf("Float: %d bytes \t\t em %p\n", sizeof(Float), &Float);
printf("Double: %d bytes \t em %p\n", sizeof(Double), &Double);
return 0;
}
And then I run the following command:
gcc pointers01.c -o pointers
I don't get any compiling errors. But when I execute the produced file (.exe) it doesn't show the UTF-8 characters:
Tipo de Dados Número de Bytes Endereço
Caractere 1 bytes em 2686751
Inteiro 4 bytes em 2686744
Float 4 bytes em 2686740
Double 8 bytes em 2686728
Caractere: 1 bytes em 0028FF1F
Inteiro: 4 bytes em 0028FF18
Float: 4 bytes em 0028FF14
Double: 8 bytes em 0028FF08
How do I do to resolve this problem? Thank you.