We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent f1b72d8 commit 95c6f94Copy full SHA for 95c6f94
snippets/c.snippets
@@ -334,6 +334,33 @@ snippet getopt
334
${0}
335
}
336
337
+
338
+## Assertions
339
+snippet asr
340
+ assert(${1:condition});
341
342
+snippet anl
343
+ assert(${1:ptr} != NULL);
344
345
+## Dynamic Allocation
346
+snippet mlc
347
+ ${1:ptr} = (${2:type}*) malloc(sizeof($2));
348
349
+snippet clc
350
+ ${1:ptr} = (${2:type}*) calloc(${3:size}, sizeof($2));
351
352
+snippet rlc
353
+ ${1:ptr} = realloc($1, ${2:size} * sizeof(${3:type}));
354
355
+snippet mlcd
356
+ ${1:type} ${2:ptr} = ($1*) malloc(sizeof($1));
357
358
+snippet clcd
359
+ ${1:type} ${2:ptr} = ($1*) calloc(${3:size}, sizeof($1));
360
361
+snippet fre
362
+ free(${1:ptr});
363
364
##
365
# TODO section
366
snippet todo
0 commit comments