what are the data types?

This is a discussion on what are the data types? within the C Programming forums, part of the General Programming Boards category; Int Char Unsigned Signed typedef byte I dont know the ones in bold, can you explain me what they do? ...

  1. #1
    Join Date
    Mar 2008

    what are the data types?


    I dont know the ones in bold, can you explain me what they do?


  2. #2
    C++ Witch laserlight's Avatar
    Join Date
    Oct 2003
    Note that keywords and identifier names are case sensitive.

    unsigned is the short form of unsigned int.
    signed is the short form of signed int, which is equivalent to int.

    typedef is not a type, but the keyword for defining new names (aliases) for types.

    A char is one byte, but byte itself is not a type unless defined as such.
    Quote Originally Posted by Bjarne Stroustrup (2000-10-14)
    I get maybe two dozen requests for help with some sort of programming or design problem every day. Most have more sense than to send me hundreds of lines of code. If they do, I ask them to find the smallest example that exhibits the problem and send me that. Mostly, they then find the error themselves. "Finding the smallest program that demonstrates the error" is a powerful debugging tool.
    Look up a C++ Reference and learn How To Ask Questions The Smart Way

  3. #3
    Technical Lead QuantumPete's Avatar
    Join Date
    Aug 2007
    London, UK
    They are not data types.
    Unsigned and Signed are modifier that tell you whether an int or a short can take negative values or not.
    Typedef is used to created your own data types
    There's no byte datatype, use char instead.

    "No-one else has reported this problem, you're either crazy or a liar" - Dogbert Technical Support
    "Have you tried turning it off and on again?" - The IT Crowd

  4. #4
    Registered User slingerland3g's Avatar
    Join Date
    Jan 2008
    For systems with tight memory, your modifiers for a variable signify how much memory that variable will consume on the system for storing data. A char is 1 byte = 8 bits as an example.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Extending basic data types.
    By nempo in forum C++ Programming
    Replies: 23
    Last Post: 09-25-2007, 04:28 PM
  2. Replies: 4
    Last Post: 06-14-2005, 06:45 AM
  3. Binary Search Trees Part III
    By Prelude in forum A Brief History of Cprogramming.com
    Replies: 16
    Last Post: 10-02-2004, 04:00 PM
  4. gcc problem
    By bjdea1 in forum Linux Programming
    Replies: 13
    Last Post: 04-29-2002, 07:51 PM
  5. Using enumerated data types
    By SXO in forum C++ Programming
    Replies: 7
    Last Post: 09-04-2001, 07:26 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21