Skip to content
| Marketplace
Sign in
Visual Studio Code>Snippets>C Snippets(private)New to Visual Studio Code? Get it now.
C Snippets(private)

C Snippets(private)

cooper

|
952 installs
| (0) | Free
Snippets for the C programming language(private)
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

C Snippets

This extension provides a simple set of VSCode snippets for the C programming language.

Visual Studio Marketplace Rating (Stars) Visual Studio Marketplace Installs Visual Studio Marketplace Downloads GitHub package.json version GitHub repo size GitHub

List of snippets:

Snippet Description Snippet Input Snippet Code
Starter Template sst #include <stdio.h>
int main (int argc, char *argv[]) {
   return 0;
}
Starter template with stlib.h libsst #include <stdio.h>
#include <stdlib.h>
int main (int argc, char *argv[]) {
   return 0;
}
Linked list template libsst typedef struct _node * Link;
typedef struct _node node;
struct _node {
   int value;
   Link next;
};
Create int function intfunc int func_name () {
   int x;
   return x;
}
Create float function flfunc float func_name () {
   float x;
   return x;
}
Create string function strfunc char[] func_name () {
   char[] x = {};
   return x;
}
Create long function strfunc long func_name () {
   long x;
   return x;
}
Print variable of type float (2 decimal places) pflo printf("var_name :>> %.2f\n", var_name);
Print variable of type int pint printf("var_name :>> %d\n", var_name);
Print variable of type char pcha printf("var_name :>> %c\n", var_name);
Print variable of type pointer ppoint printf("var_name :>> %p\n", (void *) var_name);
Print variable of type size_t psiz printf("var_name :>> %zu\n", var_name);
Allocate memory using calloc cal {type} ptr = ({type})calloc(, sizeof({type}));
if (ptr == NULL) {
   printf("Memory allocation failed!\n");
   exit(0);
}
free(ptr);

Authors: Harry Ross and Luca Merzetti

  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
© 2025 Microsoft