I do not understand what is happening.
I made a program to get a char input and output it back. I receive this exception every time I press enter to input a value into the program:
Unhandled exception thrown: read access violation. this->_format_it was 0x38.
I have tried a large arrangement of inputs and it seems that no matter what I input it will throw this at me. In fact, This is almost exactly the code my college gave me
Here is the code:
// Card Value
// cardValue.c
#define _CRT_SECURE_NO_WARNINGS
#include <stdio.h>
int main(void)
{
char rank = 'c';
printf("Enter the card rank : ");
scanf("%c", &rank);
printf(rank);
return 0;
}
Removing the address operator will result in another exception:
Unhandled exception at 0x79B498F1 (ucrtbased.dll) in Card Decks.exe: 0xC0000005: Access violation writing location 0x00000063.