I keep getting one bug in the terminal which says:
warning: format specifies type 'char *' but the argument has type 'int' [-Wformat]
scanf("%c", namehumaninput);
~~ ^~~~~~~~~~~~~~
The course I am taking is saying that all I need to do is have a char variable and thats it, use that with nothing else but clearly something is wrong. Here is the code I am having trouble with:
//Lesson 9
int inputage;
double gpainput;
char namehumaninput;
printf("Wat ur age?\n");
scanf("%d", &inputage); // scanf(); is how you do an input. You MUST have & behind a variable after a %d!!
printf("You are %d years old\n", inputage);
printf("Was yo GPA?\n");
scanf("%lf", &gpainput); // %lf is for double variables when using scanf() but using printf() it uses %s for variables. Confusing, I know.
printf("Your GPA is %f\n", gpainput);
printf("Wos yo name now that ive asked yo fo yo gpa and age\n");
scanf("%c", namehumaninput); // %c is universal for both
printf("Really? Yo name is %c?\n", namehumaninput);
I have the stdio
and stdlib
libraries imported and am using MacOS.