struct some_struct {int some; char value;};
#define SOME_STRUCT_INIT(name) \
struct some_struct *name = malloc(sizeof(struct some_struct));\
*name = (struct __##name){.some = 5, .value = 'a'}; // compound literal
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
// Use IntelliSense to learn about possible attributes. | |
// Hover to view descriptions of existing attributes. | |
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 | |
"version": "0.2.0", | |
"configurations": [ | |
{ | |
"name": "(gdb) Launch", | |
"type": "cppdbg", | |
"preLaunchTask": "${defaultBuildTask}", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"configurations": [ | |
{ | |
"name": "Linux", | |
"includePath": [ | |
// https://github.com/microsoft/vscode-cpptools/issues/5588#issuecomment-662116156 | |
"${workspaceFolder}/**", | |
"/usr/src/linux-headers-5.4.0-81-generic/arch/x86/include", | |
"/usr/src/linux-headers-5.4.0-81-generic/arch/x86/include/generated", | |
"/usr/src/linux-headers-5.4.0-81-generic/include", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
// Use IntelliSense to learn about possible attributes. | |
// Hover to view descriptions of existing attributes. | |
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 | |
"version": "0.2.0", | |
"configurations": [ | |
{ | |
"name": "GDB debug", | |
"type": "cppdbg", | |
"request": "launch", |