vendredi 20 août 2021

need explanation of behavior of using reinterpret_cast to make a double pointer hold address of an int

    int v = 10;

    int* p = &v;
    
    double* dp = reinterpret cast<double*>(p);

    cout << *dp;

the output is (-9.25596e+61) and I have found no explanation of how I got this result

Aucun commentaire:

Enregistrer un commentaire