fabregas
(usa Outra)
Enviado em 01/09/2014 - 15:33h
Estou com um arquivo de um exercício pra fazer e vou gerar o executável com o gcc gera o seguinte erro:
gcc prg1.c
prg1.c:1:10:
error: #include expects "FILENAME" or <FILENAME>
#include
^
prg1.c: In function ‘main’:
prg1.c:4:1: error: stray ‘\302’ in program
int num1,num2;
^
prg1.c:4:1: error: stray ‘\240’ in program
prg1.c:4:1: error: stray ‘\302’ in program
prg1.c:4:1: error: stray ‘\240’ in program
prg1.c:4:1: error: stray ‘\302’ in program
prg1.c:4:1: error: stray ‘\240’ in program
prg1.c:5:1: error: stray ‘\302’ in program
^
prg1.c:5:1: error: stray ‘\240’ in program
prg1.c:6:1: error: stray ‘\302’ in program
printf "\n Digite dois valores inteiros: ";
^
prg1.c:6:1: error: stray ‘\240’ in program
prg1.c:6:1: error: stray ‘\302’ in program
prg1.c:6:1: error: stray ‘\240’ in program
prg1.c:6:1: error: stray ‘\302’ in program
prg1.c:6:1: error: stray ‘\240’ in program
prg1.c:6:8: error: ‘printf’ undeclared (first use in this function)
printf "\n Digite dois valores inteiros: ";
^
prg1.c:6:8: note: each undeclared identifier is reported only once for each function it appears in
prg1.c:6:15: error: expected ‘;’ before string constant
printf "\n Digite dois valores inteiros: ";
^
prg1.c:7:1: error: stray ‘\302’ in program
scanf "%d %d",&num1, &num2;
^
prg1.c:7:1: error: stray ‘\240’
in program
prg1.c:7:1: error: stray ‘\302’ in program
prg1.c:7:1: error: stray ‘\240’ in program
prg1.c:7:1: error: stray ‘\302’ in program
prg1.c:7:1: error: stray ‘\240’ in program
prg1.c:7:8: error: ‘scanf’ undeclared (first use in this function)
scanf "%d %d",&num1, &num2;
^
prg1.c:7:14: error: expected ‘;’ before string constant
scanf "%d %d",&num1, &num2;
^
prg1.c:8:1: error: stray ‘\302’ in program
printf "\n Soma = %d\n", num1 + num2;
^
prg1.c:8:1: error: stray ‘\240’ in program
prg1.c:8:1: error: stray ‘\302’ in program
prg1.c:8:1: error: stray ‘\240’ in program
prg1.c:8:1: error: stray ‘\302’ in program
prg1.c:8:1: error: stray ‘\240’ in program
prg1.c:8:15: error: expected ‘;’ before string constant
printf "\n Soma = %d\n", num1 + num2;
Comando para compilar: gcc prg1.c. Programa:
#include
<stdio.h>
main(){
int num1,num2;
printf "\n Digite dois valores inteiros: ";
scanf "%d %d",&num1, &num2;
printf "\n Soma = %d\n", num1 + num2;
return 0;
}