[ale] solved, sort of OT: c++ datatypes question
J.M. Taylor
jtaylor at onlinea.com
Mon Jun 7 21:21:11 EDT 2004
Well, right before quitting time I tried something small and silly in the
same section of code as the line in question:
WORD tmpvar;
tmpvar = 2;
No issues on compile or run. So, thinks I, what if I do
WORD tmpvar;
tmpvar = (short)atoi(buffer);
wVar = tmpvar;
Works beautifully (buffer is my incoming string).
Now. I don't understand why that should be any different than
wVar = (short)atoi(buffer);
Where the declaration of wVar is in the header file and not inline like
above. But, it works.
I am going to follow the various suggestions I got from this list about
hunting down the definition of WORD and see if I can tell what's going on.
If anybody sees where I've been stupid, I would love to know about it.
Thanks for all the input
jenn
--
Jenn Taylor
jtaylor at onlinea.com
------------------------------------------------------------------------
Obviously, a man's judgement cannot be better than the information on which he
has based it. Give him the truth and he may still go wrong when he has
the chance to be right, but give him no news or present him only with distorted
and incomplete data, with ignorant, sloppy or biased reporting, with propaganda
and deliberate falsehoods, and you destroy his whole reasoning processes, and
make him something less than a man.
-- Arthur Hays Sulzberger
More information about the Ale
mailing list