Data types at run time

David Marks djm408 at tijc02.UUCP
Fri Dec 9 05:40:04 AEST 1988


Does anyone know how to determine the data type of a variable at runtime?

I am trying to write some code that will convert the value of a variable
to string without knowing a priori its data type. The function will be passed
a pointer to the variable. How can this function determine the variable's
data type. The only thing I DO know is that this variable will never be
a structure or a union; it CAN be any numeric (including float and double) or 
character (including string) type;

Please send e-mail and I will summarize to the net.

#include <standard/disclaimer.h>  |  LIFE IS NOT A MALFUNCTION! - Number 5 
    ____  ___ _  _  __ ____     ____    _ _  ___  ___   _ _   ____
    /  / /  /  | /  /  /  /      /     //// /  / /  /   / /  /___
   /  / /--/   |/  /  /  /   /  /     /  / /--/ /--\   / \      /
  ~~~~ ~  ~    ~  ~~ ~~~~    ~~~  ~  ~  ~ ~  ~ ~   ~  ~  ~  ~~~~
PONY EXPRESS:   David J. Marks  M/S 3520, Texas Instruments, Erwin Highway
                                P. O. Drawer 1255, Johnson City, TN. 37605 

ELECTRIC AVENUE: ...!mcnc!rti!tijc02!djm408          MA BELL: 615-461-2074



More information about the Comp.lang.c mailing list