When I try my code, I get an error which I am having trouble looking up. I get: "passing ‘double’ to parameter of incompatible type ‘const. char’"
Can someone help explain what this error means? Also can someone help me figure out how I invoked it? Thank you.
#include <stdio.h>
int main(int argc, const char * argv[]) {
float first = 3.14;
float second = 42.03;
double = first + second;
printf(third);
}
[quote]#include <stdio.h>
int main(int argc, const char * argv[]) {
float first = 3.14;
float second = 42.03;
double = first + second;
printf(third);
}
[/quote]
Look at this code:
[code]#include <stdio.h>
int main (int argc, const char * argv[]) {
float first = 3.14;
float second = 42.03;
double third = first + second;
printf ("%f", third);
}
[/code]
Can you see where you went wrong?
yea. It doesn’t look like the chapter explains this. Only the example code was given: printf(" Cook it for %f minutes.\ n", cookingTime); (Location 623) When I read this I thought “minutes” was the variable (my mistake) so I thought that the variable was expected to be within the quotations.
Anyway. Thank you.