0
How do i check a user inputted variable's type? Like double, integer or char?
2 Respuestas
0
I think i explained the question a little wrong. I am making a calculator that calculates numbers until the user inputs -1 as a number. My calculation has a switch case loop which checks thw user inputted chars like +, -, *, / and %. When i declare the varibles as integers the code works just fine, but when i change integer to double or float i have an error about the char '%'. So i want to check if user enters a double or an integer. Then i can seperate the code and if user enters doubles i wont include the '%' case to my loop. Atleast thats what im trying to do. 😓