C: recognize variable type

时间:2015-07-31 19:58:53

标签: c variables

I'm learning C. I wonder whether there is an instruction or command to recognize the type of the variable.

To be more practical: I have a program which works with integers, I want to show an error message if the user inserts a real number when running the program.

Hope you can help!

1 个答案:

答案 0 :(得分:2)

This is not part of the C standard, but GCC has the typeof keyword.

You have to be using the GCC compiler for it though.