1
I’m having a non-boot error, and I can’t figure out why:
#include <stdio.h>
int main(){
const int LENGTH = 10;
const int WIDTH = 5;
const char NEWLINE = "\n";
int area;
area = LENGHT * WIDTH;
printf("Value of area : %d", area);
printf("%c", NEWLINE);
return 0;
}
Mistakes:
C:\Users\zegla\OneDrive\Ambiente de Trabalho\Cexs\trainning6_const.c: In function 'main': C:\Users\zegla\OneDrive\Ambiente de Trabalho\Cexs\trainning6_const.c:6:24: warning: initialization makes integer from pointer without a cast [-Wint-conversion] const char NEWLINE = "\n"; ^ C:\Users\zegla\OneDrive\Ambiente de Trabalho\Cexs\trainning6_const.c:9:10: error: 'LENGHT' undeclared (first use in this function) area = LENGHT * WIDTH; ^ C:\Users\zegla\OneDrive\Ambiente de Trabalho\Cexs\trainning6_const.c:9:10: note: each undeclared identifier is reported only once for each function it appears in
Did the answer solve your question? Do you think you can accept it? See [tour] if you don’t know how you do it. This would help a lot to indicate that the solution was useful for you. You can also vote on any question or answer you find useful on the entire site (when you have 15 points).
– Maniero