r/programminghelp • u/Creepy_Version_6779 • Apr 13 '24
C++ Having trouble stringing 3 integers from a struct. C++ Beginner
I'm very new and just decided to change the integers into strings.
The integers in mind were the month day year values.
month, day, and year were changed from int to string to get the code to run. maybe im right to have them as strings? idk, is there a way to do this with integers?
0
Upvotes
View all comments
Show parent comment
2
u/DDDDarky Apr 13 '24
oh btw, one more thing, generally, you might not want to start your integers with 0.
For example, you might be surprised to learn that
std::cout << 012will actually print 10.
That is because integers starting with 0 denote octal numbers (base 8, not standard base 10)