A
arnuld
i am learning C and doing the exercise 1-1 of K&R2, where K&R ask to
remove some parts of programme and experiment with error, so here i
go:
#include <stdio.h>
int main () {
printf('hello world\n');
}
i get this error:
[arnuld@arch programming]$ gcc hello.c
hello.c:5:10: warning: character constant too long for its type
hello.c: In function 'main':
hello.c:5: warning: passing argument 1 of 'printf' makes pointer from
integer without a cast
[arnuld@arch programming]$
error 1, is pretty clear, gcc expects single character inside quotes
what does error 2 mean?
(especially the mysterious "pointer from integer without a cast")
remove some parts of programme and experiment with error, so here i
go:
#include <stdio.h>
int main () {
printf('hello world\n');
}
i get this error:
[arnuld@arch programming]$ gcc hello.c
hello.c:5:10: warning: character constant too long for its type
hello.c: In function 'main':
hello.c:5: warning: passing argument 1 of 'printf' makes pointer from
integer without a cast
[arnuld@arch programming]$
error 1, is pretty clear, gcc expects single character inside quotes
what does error 2 mean?
(especially the mysterious "pointer from integer without a cast")