×
The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.
Hi all,
I just wanted to clear up a detail of this discussion mentioned in some of
the answers. It relates to this code:
char *sBuf;
sBuf = "6027461692 ";
This is perfectly fine, you do not need to do memory allocation or declare
an array. "6027461692 " is a string literal, and when used in an
expression likes this evaluates to the address of the literal. In this
case the address of the literal will be stored in sBuf. It would be more
correct to use 'const char *sBuf;', since the string literal is most often
stored in constant storage, but that's just a nit. You would only need to
allocate storage and do a copy if you were intending to change the value of
the string.
I wonder what is the reason for long and int types if they both are 4
bytes long.
The standards for the C and C++ languages require long and integer types,
but do not require that the types be different lengths. The decision to
make both types 4 bytes long is historical, having to do with the hardware
available at the time that the lengths were defined.
Thanks,
Aaron Albertson
As an Amazon Associate we earn from qualifying purchases.