>No, it's redundant.
So is
return 0;
But people still use it for clarity. It's a stylistic issue and if you wish to use it then that's fine. If you don't want to use it that's fine too.
-Prelude
>No, it's redundant.
So is
return 0;
But people still use it for clarity. It's a stylistic issue and if you wish to use it then that's fine. If you don't want to use it that's fine too.
-Prelude
My best code is written with the delete key.
Acually this is part of a science project and I am explaining the code line by line in my paper. Now when I got my mom to look over my explination (she doesnt know much about computers) she found a few things that she didn't understand so I fixed those and now she understands them enough to understand my code. But the part I am having a hard time explaining is the seeding part. Could anyone give me a little lamens terms explination on srand?
This does not make it necessary. People can use it if they like; but by not using it, it doesn't mean it has been 'forgotten'. Which was the main point.But people still use it for clarity. It's a stylistic issue and if you wish to use it then that's fine. If you don't want to use it that's fine too.
Also, how many lines of redundant code does 'return 0' justify?1, 2 or 100 maybe? Waldo2k2 has already given the impression that redundant code has lead to his confusion (that it was necessary).
It will initialise a value used by rand to generate another value. As long as the value initialised by srand is different each time, rand will generate a different sequence of numbers.Could anyone give me a little lamens terms explination on srand?
Joe
IMO Im spontanious when I program It comes in 2000 or so line blasts I really have no time to comment or I loose my thought theres a half way ok reason....
well, what about after you finish coding, add some comments in to make code easier to read...
First you don't provide any error checking on "fstream fout("rand.txt");". I think from a stylistic point of view the program gets much cleaner if you explicitly open the file, write to it and close it in the end. Anyone who has seen the open will think it's naturall to close it.
hth
-nv
She was so Blonde, she spent 20 minutes looking at the orange juice can because it said "Concentrate."
When in doubt, read the FAQ.
Then ask a smart question.