home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Shareware Overload
/
ShartewareOverload.cdr
/
games
/
gkit.zip
/
GTIPS.DOC
< prev
next >
Wrap
Text File
|
1988-05-05
|
851b
|
23 lines
--- TIPS FOR ALL GATEWAYS PARTICIPANTS ---
Avoid using the same constant in more than 1 place in your program.
Use sizeof() or a #define macro instead.
When using sizeof(), be careful to watch what you are taking the
address of based on how you declared the variable.
For example
char ss[20]; sizeof(ss) will be 20, sizeof(ss[0]) will be 1
char *ss; sizeof(ss) will be the sizeof a pointer
sizeof(*ss) will be 1
struct { char array[20] } ss;
sizeof(ss) is 20;
struct { char array[20] } *ss;
sizeof(ss) is the size of a pointer
sizeof(*ss) is 20;
Make sure that any pointers you use are initialized to point to
valid data including pointers passed to functions.