Got some homework I'm working on and I'm having issues getting a char datatype to display, or maybe it's not reading the input prompt. I've tried a dozen different ways of writing this and it still won't display.
#include <stdio.h>
int main(void)
{
char grade;
printf("Enter in a grade: A, B, C, D, or F \n");
scanf_s("%c", &grade);
printf("I expect my grade to be %c in this class. \n", grade);
Great! That worked with the ', 1' at the end. My compiler won't let me use regular scanf and prompts with an "error C4996" and is forcing me to use scanf_s which we obviously haven't covered in class.
My compiler won't let me use regular scanf and prompts with an "error C4996" and is forcing me to use scanf_s which we obviously haven't covered in class.
I really hate that about VS. But it's fixable.
The easiest way to fix it is to put this at the top of your file: