[Solved] Is there any shortcut in Visual Studio that implements basic structure of C and C++?


This page explains how to create your own snippets

Those are the steps on macOS:

  • Select User Snippets under Code > Pereferences
    Menu screenshot
  • Select the C language
  • Create the snippet in the JSON file

A snippet generating the basic structure of a program could look like this:

{
    "Skeleton": {
        "prefix": "main",
        "body": [
            "#include <stdio.h>",
            "#include <stdlib.h>",
            "",
            "int main(void)",
            "{",
            "\t${1:code}",
            "\treturn 0;",
            "}",
            ""
        ],
        "description": "Dummy C program skeleton"
    }
}

This is what it looks like:
Snippet demo

0

solved Is there any shortcut in Visual Studio that implements basic structure of C and C++?