Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

zergdeath1

I want to share in your knowlege!

This topic is 5565 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

Ok I have a lot of questions about C and I was hoping that you would help me answer them I you could would please do so as this is probably cofusing others to thanks: 1. Why does C have so many ways to input numbers, int, float, double, char, signed, unsigned, etc... 2. Do i really need to memorize all of them and there related features early in programming? 3. What is the differance between signed and unsigned? Is it really nessecery? 4. I do not understand the CHAR funtion at all could you explain it to me? or tell me what use it is i meen it doesnt seem to have a purpose. 5. Are all of the above things neccessary to know how to program? Thanks for Helping me. I would also like help understanding octal, hexidecimal #s: 1. What is the differance? 2. Can you help me learn how to read and convert to and from them? 3. Do I need to know them for C? 4. Any other information about these...? 5. Do you know of any websites that might help me understand Octal or hexidecimal numbers? Please if you can thank you?

Share this post


Link to post
Share on other sites
Advertisement
1. Why does C have so many ways to input numbers, int, float, double, char, signed, unsigned, etc...

Because they provide flexibility, and they serve different purposes.

2. Do i really need to memorize all of them and there related features early in programming?

Yes. But it'll come by itself, don't bother studying.

3. What is the differance between signed and unsigned? Is it really nessecery?

Signed means it can have a negative sign. Unsigned means it cant. Signed and unsigned types all hold the same amount, for example:

Signed: -10 - 10
Unsigned: 0 - 20

They each hold 20 numbers.

4. I do not understand the CHAR funtion at all could you explain it to me? or tell me what use it is i meen it doesnt seem to have a purpose.

It's not a function, it's a type. A char holds a letter or symbol from the set of ASCII characters, of which there are 256. (128 non-extended, and 128 extended). Technically it's just a number though.

5. Are all of the above things neccessary to know how to program?

Yes.

I would also like help understanding octal, hexidecimal #s:

1. What is the differance?

They're just different bases. Base 8, and base 16.

2. Can you help me learn how to read and convert to and from them?

There are tutorials online.

3. Do I need to know them for C?

Probably not yet. But it's good to understand the concepts.

4. Any other information about these...?

No.

5. Do you know of any websites that might help me understand Octal or hexidecimal numbers?

Yes. I'll post one later, but use google.

[edited by - cowsarenotevil on September 24, 2003 8:52:39 PM]

Share this post


Link to post
Share on other sites
quote:
Original post by zergdeath1
Ok I have a lot of questions about C and I was hoping that you would help me answer them I you could would please do so as this is probably cofusing others to thanks:

1. Why does C have so many ways to input numbers, int, float, double, char, signed, unsigned, etc...


Because there is more than one type of possible input. Also the size of the variables varies so if you know a value will range from 0-255 use a 1 byte char as opposed to a 4 byte integer. (space reasons, use what you need but no more)

quote:
Original post by zergdeath1
2. Do i really need to memorize all of them and there related features early in programming?


There aren''t that many at all so learning them could not hurt.

quote:
Original post by zergdeath1
3. What is the differance between signed and unsigned? Is it really nessecery?


Signed: uses an an extra bit to keep track of negative or positive
Unsigned: only positive but you get that extra bit

You could get around it but thats up to you.

quote:
Original post by zergdeath1
4. I do not understand the CHAR funtion at all could you explain it to me? or tell me what use it is i meen it doesnt seem to have a purpose.


char function? I don''t know. If you mean the char type than its a value from 0-255 (as above) that is usually used in conjunction with ascii (numeric->alphabetical) tables.

quote:
Original post by zergdeath1
5. Are all of the above things neccessary to know how to program?


Yup.

quote:
Original post by zergdeath1
Thanks for Helping me.

I would also like help understanding octal, hexidecimal #s:

1. What is the differance?


The base. each place is worth x units where x is the base. So, with base 10 you have 10 possible digits in each spot (0-9), with base-2/binary you have 2 and hex you have 16.

quote:
Original post by zergdeath1
2. Can you help me learn how to read and convert to and from them?


Google

quote:
Original post by zergdeath1
3. Do I need to know them for C?


Not initially but they''ll leap upon you one way or other probably.

quote:
Original post by zergdeath1
4. Any other information about these...?

5. Do you know of any websites that might help me understand Octal or hexidecimal numbers?


Again, just google for hex or octal (with words like "tutorials" etc)

Share this post


Link to post
Share on other sites
1. Why does C have so many ways to input numbers, int, float, double, char, signed, unsigned, etc...

*** The reason for this is because memory managment is one of the biggest things around, and if u use the right datatypes u can save memory

2. Do i really need to memorize all of them and there related features early in programming?

***I think you should memoize these, because if u dont understand these then you wont understand anything else

3. What is the differance between signed and unsigned? Is it really nessecery?

*** signed variables are variables that can have negative values(eg. signed int can go from approx -32000 to +32000) unsigned have advantages if you need higher +ve values(eg. unsigned int would go from 0 to approx 64000)


4. I do not understand the CHAR funtion at all could you explain it to me? or tell me what use it is i meen it doesnt seem to have a purpose.

*** first of all char is a datatype not a funtion, char is just used for characters, and character strings, but it can also be used to hold 1 byte of data, not just letters, so its really good for small numbers

5. Are all of the above things neccessary to know how to program?

*** Definately, get to know these well and memory managment and pointers and compound types wont be so difficult

Thanks for Helping me.

I would also like help understanding octal, hexidecimal #s:

1. What is the differance?

*** Hexidecimal(Hex) is what the computer uses to point to memory, and octal is just a different method, not to sure bout that.

2. Can you help me learn how to read and convert to and from them?

*** I''m sure there is help on the net you can find, but i suggest getting c++ primer plus book its amazing

3. Do I need to know them for C?

*** uhhh, Hex is good for learning how to use pointers, but its not a MUST

4. Any other information about these...?

*** mostly these are useful when low-level programming, but you wont be using this for a long time, until you are really in depth

5. Do you know of any websites that might help me understand Octal or hexidecimal numbers?

*** try cplus.about.com

Please if you can thank you?

Share this post


Link to post
Share on other sites
Try Here.

The Appendix C has a pretty good explaination of base (something other than ten) numbering and the chapters have good explainations to cover your other questions (and more) as well.

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
Wait a minute... Maybe I''m just being stupid, but in response to the last two posts... Ummm... Didn''t he ask for information about C ? I don''t think the links you provide will help him.

For the author:

Here is a little link for ya: http://www.refcards.com/about/c.html

Memorize that, and you are set.

Share this post


Link to post
Share on other sites
Umm, well I never bothered to learn C before I learned C++ but I''m pretty sure that the link I provided answers the few specific questions he had.. learning to count in base 6 or 8 or 2 or whatever isn''t exactly language specific.

Now if he wanted to read ever chapter of the book in the link I provided, then yeah, there might, definatly, be some problems if he''s working in just C.. but I still don''t see how these links won''t help with what he was requesting information on..

Share this post


Link to post
Share on other sites
quote:

Signed: -10 - 10
Unsigned: 0 - 20

They each hold 10 numbers.


20-0=20
quote:

(eg. signed int can go from approx -32000 to +32000)


Accually, on a 32bit OS, it''s -2,147,483,647 to +2,147,483,648 and
0 to +4,294,967,296.
Everyone else pretty much answered your questions, but just so you know most of those answers could''ve been found either google''ing the web or searching the google c++ programming newsgroup.

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!