Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
snippets:c:start [2011/05/25 21:32] – codebrainz | snippets:c:start [2011/06/13 17:39] (current) – replace tag index list by nspages list enrico | ||
---|---|---|---|
Line 1: | Line 1: | ||
====== Collection of Snippets for C ====== | ====== Collection of Snippets for C ====== | ||
- | {{topic> | + | Longer, more elaborate Snippets are described in sub-pages list below. |
- | {{tag> | + | <nspages -title -simplelist -exclude: |
+ | |||
+ | ====== Structures ====== | ||
+ | |||
+ | |||
+ | The following two snippets will insert a '' | ||
+ | |||
+ | < | ||
+ | _ts=typedef struct\n{\n\t\n}\n%cursor%; | ||
+ | _s=struct %cursor%\n{\n\t\n}; | ||
+ | </ | ||
+ | |||
+ | The respective insertions are: | ||
+ | <code c> | ||
+ | typedef struct | ||
+ | { | ||
+ | |||
+ | } | ||
+ | /* CursorGoesHere */; | ||
+ | </ | ||
+ | <code c> | ||
+ | struct /* CursorGoesHere */ | ||
+ | { | ||
+ | |||
+ | }; | ||
+ | </ | ||
+ | |||
+ | The cursor will be placed where ''/ | ||
+ | |||
+ | ====== Main function ====== | ||
+ | |||
+ | This snippet inserts a '' | ||
+ | |||
+ | < | ||
+ | _m=int main(int argc, char *argv[])\n{\n\treturn 0;\n}\n | ||
+ | </ | ||
+ | |||
+ | This snippet results in the insertion: | ||
+ | |||
+ | <code c> | ||
+ | int main(int argc, char *argv[]) | ||
+ | { | ||
+ | /* CursorGoesHere */ | ||
+ | return 0; | ||
+ | } | ||
+ | </ | ||
+ | |||
+ | The cursor will be placed where ''/ | ||
+ | |||
+ | {{tag> |