I've been playing around with pointers and i have encountered my process terminating after it's done with the traditional windows "is not responding" and exit code -1073741819 (0xC0000005).
quickfix suggested by my IDE was to initialize the *ptr with __p__fmode().
However I read that, "The __p__fmode function is for internal use only, and should not be called from user code."
If you would be so kind to help me with this problem pretty please :)
#include <iostream>
using namespace std;
// Code written in Jetbrains's CLion with mingw-w64 compiler
int main() {
int r, c, *ptr = __p__fmode(); // No idea what's that __p__fmode(), but without it process terminates
// with code "Process finished with exit code -1073741819 (0xC0000005)"
cout<<"Enter number of rows for Matrix A:";
cin>> r;
cout<<"Enter number of columns for Matrix A:";
cin>> c;
int A[r][c];
A[0][0] = 0;
A[0][1] = 1;
A[1][0] = 2;
*ptr = A[0][0];
cout<<*(*(A+0)+0)<<"\t";
cout<<*(*(A+0)+1)<<"\t";
cout<<*(*(A+1)+0)<<"\t";
}