n077gh@tamuts.tamu.edu (Sharma Anupindi) (05/23/91)
Hai,
Is there a way of declaring a constant as a variable of a different
type.
it is something like the intern function of lisp.
for example;
char name[20] = {"sharma"};
int sharma;
here I stored "sharma" in the var, name. But in my problem I read the string
from a data file and store them in the var name which is the elemet of a struct.
that is something like struct[1].name="ghjghj" and struct[2].name="hgjghj".
And after reading them from a file I should declare the strings as a variable
of different type ( like int in the example).
I would like to have this in `C', and if it is not possible in `C', C++ will
also do.
Sharma.
n077gh@tamuts.tamu.edugwyn@smoke.brl.mil (Doug Gwyn) (05/23/91)
In article <16435@helios.TAMU.EDU> n077gh@tamuts.tamu.edu (Sharma Anupindi) writes: >I would like to have this in `C', and if it is not possible in `C', C++ will >also do. I honestly could not make heads nor tails of your question. It appeared to me that your main problem is in attempting to use C without understanding C first. I'd suggest studying a good C text (such as Kernighan & Ritchie's "The C Programming Language"), then restating any remaining question in terms that make sense.