Valera (valera) wrote,
Valera
valera

c++ and variable types

silly me
after a few days of trying to find someone who knew the answer, countless futile times of trying to connect to irc to get into a c++ channel... and my genius decision to continue reading the book which presented the problem itself, only to find the answer to the problem in the next few lines.

here's the problem for those interested in my c++ adventures or in c++ itself:
the book listed the ranges and the sizes of different integer variable types.
it said that int and long had the exact same range and size. that troubled me, because it seems quite useless to have two variable types with different names to serve the exact same function.

as it turns out, the range and the size of a variable type depends on the computer the program is running on. as in - on some computers the values will be different, on most though, they will be the same.


well, almost 3am, and i have work tomorrow.


cheers...
Subscribe
  • Post a new comment

    Error

    default userpic

    Your reply will be screened

    Your IP address will be recorded 

    When you submit the form an invisible reCAPTCHA check will be performed.
    You must follow the Privacy Policy and Google Terms of use.
  • 0 comments