C/C++ header guard snippet for vsCode
- click 'Manage' on left bottom.
- Select 'User snippets' then 3a. Click on either 'New Global Snippets file...' 3b. or click on 'New snippet for ' whatever it is
- Add a name to the snippet
- Clear everything from the template, then paste the code snippet from this repo.
- Save and close
When user creates an empty C/C++ header file, simply get start typing the following text:
guard
pressing ENTER the empty file will be filled with the header guard contents.
dummy.h before snippet applied
after snippet applied
#ifndef __DUMMY_H__
#define __DUMMY_H__
#ifdef __cplusplus
extern "C" {
#endif
#ifdef __cplusplus
}
#endif
#endif // __DUMMY_H__