flexlm

How to get pointer sized integer using scanf?

旧巷老猫 提交于 2019-12-13 02:27:09
问题 I have some inherited code for FlexLM that is converting an integer to a pointer that needs to work on both 32bit and 64bit machines. The integer is being filled in from argc of the arguments to the program using scanf to read the integer value. How should I reliably read the argc string to get a value suitable for assigning to a pointer so that it works on both 32bit and 64bit machines? Presently the code looks something like this: // FlexLM includes this: typedef char * LM_A_VAL_TYPE; /* so