SYNTAX- I'm a beginner and need some help.

I set out to make a Random number generator.
I am still new to C++. I made my first random number generator, then tried making it a different way, and then another way. My reason, is the syntax. I am unsure how it is supposed to be put together.

The reason for this post is for constructive criticism, and advice on how to be better at what I do, and to learn the correct way.

I think firstly would be the time header shouldn't it be #include <ctime> for c++ standard or #include <time.h> for non-standard c library. Secondly you are using all of std namespace in the global scope but only actually using std::cout in your functions..and thirdly don't use global variables...which you called public variables which I guess technically is correct because public means you can use outside of its scope. Then you actually never set the default values for tries and tried like you said like palauan said. ANd on line 46 and 52 if you are ever incrementing a number by 1 instead of number = number +1 you can just do number++; so on line 46 you can puttried++; By the way the formula for getting a pseudo random number with the rand() function is rand() % ( HIGH - LOW + 1 ) + LOW;

palauan73-
Oh yes, sorry bout that,some of the //comments were from yesterday, and I have changed a few things.

giblit-
I am learning C++ myself, and Ive googled it many times, and couldnt find a definite answer on the time thing. thanks for clearing this up, I will note, #include <ctime> or #include <time.h> (whats the difference between standard and non standard?/pros and cons?)

number = number +1;
number++;
^^ I learned this in java script, but I didnt think about it, thanks for that info, ill note that also.

rand() % ( HIGH - LOW + 1 ) + LOW;
^^^^^ this will give me a "random" number each time I call it?
if so, I dont need ctime.

rand() % ( HIGH - LOW + 1 ) + LOW;
^^^^^ this will give me a "random" number each time I call it?
if so, I dont need ctime.

You will still need to call the random seed srand( time( NULL ) ) atleast once preferably at the top of your main function so that way you will generate a new seed. Otherwise each time you try and call a random number it will more than likely be the same number.

So, make the variables I need inside the parameters of the functions?
Also, I notice everyone else using;std::
instead of how I do it;usingnamespace std;
is the way I do it, not correct, and can it lead to difficulties in the future?

it can lead to slowing down your program because there are a ton of things in the namespace of std if you do unsing std::cout in the function you are using cout it is better but it is best to just do std::cout each time you use it and don't bother with the using std::whatever