c:index
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| c:index [2009/08/13 10:26] – tkbletsc | c:index [2011/03/03 11:28] (current) – tkbletsc | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| + | ====== C/C++ code snippets ====== | ||
| + | |||
| + | |||
| * [[getopt]] | * [[getopt]] | ||
| * [[key-value pairs]] | * [[key-value pairs]] | ||
| * [[timing]] | * [[timing]] | ||
| + | * [[memmem]] - find substrings of raw memory (as opposed to null terminated strings) | ||
| + | * [[Getting mixed C and assembler output]] | ||
| < | < | ||
| Line 7: | Line 12: | ||
| #include < | #include < | ||
| #include < | #include < | ||
| + | |||
| + | #ifdef DEBUGMSG | ||
| + | #define DEBUG printf | ||
| + | #else | ||
| + | #define DEBUG(...) | ||
| + | #endif | ||
| #define die(...) { fprintf(stderr, | #define die(...) { fprintf(stderr, | ||
| Line 14: | Line 25: | ||
| char suffix; | char suffix; | ||
| if (sscanf(s," | if (sscanf(s," | ||
| - | if (suffix==' | + | if (suffix==' |
| else if (suffix==' | else if (suffix==' | ||
| else if (suffix==' | else if (suffix==' | ||
| Line 26: | Line 37: | ||
| } | } | ||
| + | char* tok; | ||
| + | for (tok = strtok(value,"," | ||
| + | ... | ||
| + | } | ||
| </ | </ | ||
c/index.1250184374.txt.gz · Last modified: by tkbletsc
