I'm trying to debug C++ code in VS Code with GDB. But here I'm unable to add an element to an array.
I even tried add element using below code
for(int i = 0; i < n ; i++){
arr[i] = i;
}
Which ideally should give array of element from 0, 1, 2, 3, 4, 5.
Below is the snippet from my debugger.
My launch.json
{
"version": "0.2.0",
"configurations": [
{
"name": "g++.exe - Build and debug active file",
"type": "cppdbg",
"request": "launch",
"program": "${fileDirname}\\${fileBasenameNoExtension}.exe",
"args": [],
"stopAtEntry": false,
"cwd": "${workspaceFolder}",
"environment": [],
"externalConsole": false,
"MIMode": "gdb",
"miDebuggerPath": "C:\\MinGW\\bin\\gdb.exe",
"setupCommands": [
{
"description": "Enable pretty-printing for gdb",
"text": "-enable-pretty-printing",
"ignoreFailures": true
}
],
"preLaunchTask": "C/C++: g++.exe build active file"
}
]
}