Hey guys I have this program that doesn't compile
This is the error it gives:Code:#include <stdio.h> typedef struct{ double price; double tax; }Book; double findTotal(Book cartoon); void main(void) { Book comics = {0.0, 0.0}; double total = 0.0; readdata(comics.price, comics.tax); total= findTotal(comics); puts(total); } double findTotal(Book cartoon) { double total; total= cartoon.price+cartoon.tax; return total;
Is their a way to keep the main void still return the value of total to it?Code:test2.c: In function `main': test2.c:16: incompatible type for argument 1 of `puts' test2.c:10: warning: return type of `main' is not `int'
And why is it giving me error for puts?
thanks for any help



LinkBack URL
About LinkBacks



.