A: In your code, you define a vector and intialize it empty, then you push_back to it each time. The vector is a stack of pointers, not the actual values. Instead of this, just assign it with no data. std::vector stdVector; stdVector.assign(“c: file.txt”); stdVector.assign(“C: file.txt”); As a side note, there are multiple issues with your code. $-dimensional system, described by a wave function$\Psi(x)$(in what follows$x$denotes both the position$x$and the spin quantum number$\uparrow, \downarrow$), we propose a simple and intuitive procedure of measurement of the probability$p$of a given spin flip$\ket{\uparrow}\rightarrow\ket{\downarrow}$: 1\. The system is prepared in an eigenstate$\ket{\psi_0}$(in our case$\ket{\psi_0}=\ket{\uparrow}$) of the$z$component of the spin. 2\. In order to check that the measuring device is actually working, let us test whether an annihilation operator$\hat{\psi}(x)$is present or not in the state$\ket{\psi_0}$. The annihilation operator is defined as a new operator$\hat{\psi}(x)= \hat{I} \hat{\psi}^\dagger(x)$being the identity operator$\hat{I}$and$\hat{\psi}^\dagger(x)$the adjoint operator of the operator$\hat{\psi}(x)$. After$N$consecutive measurements of the annihilation and creation operators, the probability of a given spin flip$\ket{\uparrow}\rightarrow\ket{\downarrow}$is just$p=N_\downarrow/N$(here$N_\downarrow$is the number of measured annihilation operators). 3\. If all the annihilation operators were measured, it is clear that the system is in an eigenstate$\ket{\psi_0}$of the$z$component of the spin$\hat{S_z}$:$\$\ket{\psi_0} = \hat{\psi}^\dagger(