Hello, I need to display the difference of two binary numbers using the strtol function. I wrote the code, but it outputs it to me in 10 cc, but it should be in the 2nd. Do not tell me how to fix?
void Diff(string bin1, string bin2) { cout << strtol(bin1.c_str(), NULL, 2) - strtol(bin2.c_str(), NULL, 2) << endl; system("pause"); } where bin1 and bin2 binary numbers. At the same time, it is this team that needs to be output, and not to make a translation after subtraction ...
cout, without translating into a string? such flags, as I recall, are not provided ... - Harry