I am new to C++ Programming. I'm getting Segmentation Fault
error while compiling my code in online compilers but when I try compile it using Visual Studio Code
and g++
in offline(means in my local machine) works fine.
The Code
I have tried is
`
#include <iostream>
int main() {
int *ptr;
*ptr = 10;
cout<<*ptr; //Prints 10
cout<<ptr; //Prints Some garbage address
}
But the above program not working in online compilers(used onlinegdb). My machine configuration g++ 11
Visual Studio Code 2016
Aucun commentaire:
Enregistrer un commentaire