Below I will paste my first program, but, my issue I think is with DEV C++. We downloaded DEV C++ onto the computer at school, and it runs perfectly, outputs the .cpp and .exe files perfectly, and runs everything perfectly.
I get home and run the .exe and it starts like normal, but halfway through it crashes. I can compile and run it through the DEV C++ program and it works perfectly. I can even edit things within my code and the .exe will reflect my changes, but still crash at the same spot... I have no errors or warnings...
It crashes on line 36-38 (or maybe 40-42) after "Enter number of trees to plant: ";
But like I said, when I compile and run it through DEV C++ it works perfectly...
I just noticed your corrections to my code, I appreciate that, tomorrow I will examine it and try to understand it all... then implement it... but for now, I'm tired, I'll check back in the morning.
Haha, I figured out how to display code properly, thanks for that also.
The only issue now is that it, along with code::blocks, may come bundled with TDM-GCC. In itself, that is pretty good as a start, but it hasn't been updated since 2015 - which at the moment in some respects is almost a lifetime. C++ is undergoing various revision stages, and if you want to use the very latest features then you'd need to separately install a newer compiler - which is probably more than one should be asking of a beginner.
The only issue now is that it, along with code::blocks, may come bundled with TDM-GCC. In itself, that is pretty good as a start, but it hasn't been updated since 2015 - which at the moment in some respects is almost a lifetime. C++ is undergoing various revision stages, and if you want to use the very latest features then you'd need to separately install a newer compiler - which is probably more than one should be asking of a beginner.
The things I am looking for:
1. I would prefer it to be all in one (comes with a "good" compiler).
2. I would prefer it to be light - as my home PC is older, some programs make it run hard (and slow).
3. I would love for it to be a standalone so I can use it at home and at different computers at school straight from my flash drive.
4. I want to find one program that accomplishes all of the specifications above so I can get used to it and only work on that one program - as a beginner I don't want to worry about the different nuances from different programs.
It looks like Visual Studio can be run off a USB drive although it takes some work, you'd have to look into that one. Eclipse on the other hand can apparently be run on USB, I've never used it so you'd also have to look into that one, but I've heard good things about Eclipse so its worth taking a look I'd say.
If the two computers run on different operating systems it won't be compatible on both. I'm not completely sure what all else could've happened as I only code on two devices but I'm guessing its just a compatibility issue. Unfortunately C++ isn't nearly as compatible as languages such as java, where you could run it on probably any machine you could think of.
I added (below) right before return 0; at the end and that fixed the problem.
system ("pause");
It doesn’t fix anything: it keeps the console window opened until you press the ENTER key.
A console program can execute and close in a blink, so fast that you could not see it.
But you could have noticed that there are two posts pinned in the first page of the beginners forum, one of which is this: http://www.cplusplus.com/forum/beginner/1988/
Just have a look at it.