|
Quick Navigation Bar creating libraries :: tips and tricks :: overview [ toc | forums ] |
Note: If the document URL does not begin with http://randu.org/tutorials/c/ then you are viewing a copy. Please direct your browser to the correct location for the most recent version. |
Below is a listing of a few tips you can use when you are programming.
*/ comment end
is prematurely termanating your comment block. You can utilize the
C Preprocessor's #if directive to circumvent this:
#if 0
/* This code here is the stuff we want commented */
if (a != 0) {
b = 0;
}
#endif
#define.
Expanding on that, it is even more convenient if you write
a macro (using the PRINTF() macro from the I/O section):
#ifdef DEBUG #define DPRINTF(s) PRINTF(s) #else #define DPRINTF(s) #endifNow you can have
DPRINTF(("Debugging statement")); for
debugging statements! This can be turned on and off using the
-DDEBUG gcc flag.K (capital k).(global-set-key [(f1)] (lambda () (interactive) (manual-entry (current-word))))Now you can load up emacs put the cursor on the word in question and press the
F1 key to load up the man page on it. You
can replace the F1 key with anything you wish.
