Checking for "out of bounds" address?
The sadistic bastard who wrote this test harness decided to load Keys & Values from a config file, but he defined the Values array as a union of unsigned long, char* so either numbers or strings could be stored.
I'm trying to print out all the keys & values after they are parsed from the file, but I have no idea if the value is a number or string, so if I print it as a string when it's just a number I get a Segmentation fault.
In C is there any way to check if a pointer is valid before using it?
I'm guessing not. What about trying to print a char* pointer and not crashing if it's invalid (kind of like catching an exception)?