C_quicknotes
Takeaways from the book “Advanced C Programming” by Berry, John Thomas.
While it’s titled “advanced”, it is rather basic. Here is some quick notes on stuff that I’m not familar with/ don’t use often.
define variables as global to a small region of program
Global variables always involves the possibility of side effects. By keeping the coupling well controlled, we minimize some of this danger.
|
|
Using stack to hide global variables from the rest of the program
main.c
|
|
lib.c
|
|
to avoid this, declare the global variables as static so that their scopes are restricted only to the home file.
|
|
Declaring functions in main to limit the scope: only use there!
|
|
Bitfield
|
|
[+] click to leave a comment [+]
the comment system on this blog works via email. The button below will generate a mailto: link based on this page's url and invoke your email client - please edit the comment there! [optional] even better, encrypt the email with my public key - don't modify the subject field - specify a nickname, otherwise your comment will be shown as anonymous - your email address will not be disclosed - you agree that the comment is to be made public. - to take down a comment, send the request via email.>> SEND COMMENT <<