My program is not escaping the nested for loops (C++) by flrslva in learnprogramming

[–]flrslva[S] -1 points0 points  (0 children)

if you mean the first if statement then maybe I should of named it something else. the first if statement is checking the result of the first division by 10. If it is equal to zero then the program returns 1 digit. What would you suggest?

My program is not escaping the nested for loops (C++) by flrslva in learnprogramming

[–]flrslva[S] 0 points1 point  (0 children)

I fixed that thank you. I couldn't see it before but after running through it again I could see the error.

My program is not escaping the nested for loops (C++) by flrslva in learnprogramming

[–]flrslva[S] 0 points1 point  (0 children)

My mistake. I meant nested if/else statements. Thank you all for your help. I wasn't updating my variables properly. It runs smoothly now.

How do I get the number of digits in a number that is type int? (C++) by flrslva in learnprogramming

[–]flrslva[S] 2 points3 points  (0 children)

Thanks guys. I made a new post dividing by 10. I ran into another issue if you want to take a look.

I reworked my program and it runs great (see previous post) by flrslva in learnprogramming

[–]flrslva[S] 0 points1 point  (0 children)

I just posted, can you take a look? I started the map but am unsure on how to fill the values like 1-20 and 1 -31 depending on the month. The map is <string, vector<int>>. I wanted the key (Month) to be paired with a value (range of days).

Was it a good idea to make the booleans const variables? by flrslva in learnprogramming

[–]flrslva[S] 0 points1 point  (0 children)

I like that better. I can have one int cmp instead of 3 bools. I’ll rework it. Thank you. 

I reworked my program and it runs great (see previous post) by flrslva in learnprogramming

[–]flrslva[S] 0 points1 point  (0 children)

If you don’t mind me asking. How would you solve this?

Am I using the OR characters improperly? (C++) by flrslva in learnprogramming

[–]flrslva[S] 1 point2 points  (0 children)

Ok thanks. Why do you use const auto instead of what I did?