Can anyone tell me about these lines that why we use them in our program during filehandling process..Thanks in advance.. :)
int pos=(-1)*static_cast<int>(sizeof(account))
Can anyone tell me about these lines that why we use them in our program during filehandling process..Thanks in advance.. :)
int pos=(-1)*static_cast<int>(sizeof(account))
Having just one line to look out a complete answer is impossible but the line of code gets the size of the account object, uses the static_cast method to convert it to an int (which it was already but is probably used to avoid any unsafe type issues).
Then it's multiplied by -1 and stored in the pos variable.
So, basically, it is the negative size of the account object.
What happens with it then is anyone's guess.
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.