In C programming, how do i check whether char array[] contains int, float or double value and also store the value using respective data type?
Example:
If the char array[] contains 100 – its int value and should be store in int a.
if the char array contains 10000.01 its float value and should be stored in float b.
The only way you can store mixed types in an array is to have an array of pointers.
You’d need to use a struct or a union to store each one too like so:
No using the above you can store type information