我遇到了GCC编译器和Windows CMD的问题,因为我无法正确看到UTF-8字符.我有以下代码:
#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", …Run Code Online (Sandbox Code Playgroud) 我正在尝试创建一个使用默认值创建二维数组的函数.然后,该函数应返回该静态数组的指针.
int* novoTabuleiro() {
static int *novoTabuleiro[LINHAS][COLUNAS];
//Some changes
return novoTabuleiro;
}
Run Code Online (Sandbox Code Playgroud)
然后我想做这样的事情:
int *tabuleiroJogador = novoTabuleiro();
Run Code Online (Sandbox Code Playgroud)
上面的功能有什么问题.我收到的错误是"从不兼容的指针类型返回".谢谢.