#include <bits/stdc++.h>
using namespace std;
vector<int> vb;
int main() {
vb.push_back(9);
cout<<vb[0];
return 0;
}
breakpoint at line 7
output->9 as expected.
but when i write-->"vb[0]" on debug console the whole thing crush with error-->
ERROR: GDB exited unexpectedly. Debugging will now abort.
The program 'c:\Users\Belayet Hossain\Documents\vs code project\other\other.exe' has exited with code -1 (0xffffffff).
my launch.json:
{
// 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": "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:\\Program Files\\mingw-w64\\x86_64-8.1.0-posix-seh-rt_v6-rev0\\mingw64\\bin\\gdb.exe",
"setupCommands": [
{
"description": "Enable pretty-printing for gdb",
"text": "-enable-pretty-printing",
"ignoreFailures": true
}
],
"preLaunchTask": "C/C++: g++.exe build active file"
}
]
}
#include <bits/stdc++.h>
using namespace std;
struct other
{
int a,s,d;
int get_a(){
return a;
}
};
int main() {
struct other cv={1,2,3};
cout<<cv.get_a();
return 0;
}
the script->
breakpoint at line 7
output->9 as expected.
but when i write-->"vb[0]" on debug console the whole thing crush with error-->
my launch.json: {
and task.json:
same thing happen when script-->
and on debug console calling
cv.get_a()