So I'm still new to C++ (don't know a lot outside of what is here) and this is the first time I've ever gotten a warning at all. I'm just curious what it is and how and why I should fix it.
I get:
Line 57 - "name lookup of 'i' changed"
Line 8 - "matches this 'i' under ISO standard rules"
Line 18 - "matches this 'i' under old rules"
I have no idea what any of this means and would be grateful if someone could explain it.
ANY tips/help about my question or about anything in my code is always appreciated
By the way I made this to simulate the first roll in the game of Monopoly and the chances of where you would land each time. I'm going to have it display the percentages of the simulation next.
Sorry if anything is unclear. I know the code is pretty messy.
That is the simplest, but you can also use the memset() function from the <cstring> header. I personally would use the one you already have, but it is up to you.
another thing is that you wrote: int i, roll_1, roll_2, roll_end; //defining the index for my for loops
but after you wrote for(int i = 0; i<40; i++)
you said int i twice. You can only initiazize i onece.
what you can do is change the first to int roll_1,rool_end, roll_end;
or change the second to for( i = 0; i<40; i++)
oh and the answer to your first post is yes, there is a way too make it "neater" for other peaple to look at. you can make rolling a dice a function.
by doing function.....roll dice the loop is choice times.
it. that way you can actually input ANY number of time to simulate it. Ya thats it good luk!