I have several variables of type char (array), int, and double. Is there a way to identify what type they are during run-time?
For example, I'm looking for something like:
int dummyInt = 5;
double dummyDouble = 5.0;
dummyInt == int ?
printf("yes, it's of int type\n") : printf("no, it's not of int type\n");
dummyDouble == int ?
printf("yes, it's of int type\n") : printf("no, it's not of int type\n");
Where the obvious results will be:
yes, it's of int type
no, it's not of int type
Well, the reason why I need it is because I'm transferring data from variables into an SQL database (using SQLite). Now, the headers can change each time I run the program depending on which variables are being used. So when I'm creating the table, I need to tell it if it's VARCHAR, INTEGER, DOUBLE etc.