Sign in to follow this  

Need to clear up some terms... (C++)

This topic is 4514 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

What do these terms mean in C++? short and long signed and unsigned ushort Can someone put them in plain dumb terms for me? It will help me on my quest to learn C++ ;) Thanks, Final

Share this post


Link to post
Share on other sites
signed can be posative and negative
unsigned is just posative

eg
signed int can go from -2,147,483,648 to 2,147,483,647
unsigned int can go from 0 to 4,294,967,295

im pretty sure that right im just learning myself im say here with a book right now doing some exercises

Share this post


Link to post
Share on other sites
Short and long are both number type the same as int, except their possible range of numbers is shorter and longer respectively in most cases. The exact ranges of short and long may be different for each C++ implementation IIRC, so do not count on them being 16-bit or 64-bit.

A signed variable allows you to store numbers below zero. An unsigned does not. If a number is signed, then it reserves either the first or last bit (I cannot remember) to tell if a number is positive or negative. If it is unsigned, that last bit is used for the number itself. Using an unsigned number increases your range of positive numbers.

ushort is an unsigned short.

Update: Here you go. Read that.

Share this post


Link to post
Share on other sites

This topic is 4514 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this