Thread: what are the data types?

  1. #1
    Banned
    Join Date
    Mar 2008
    Posts
    78

    what are the data types?

    Int
    Char
    Unsigned
    Signed
    typedef
    byte



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

    Thanks.

  2. #2
    C++ Witch laserlight's Avatar
    Join Date
    Oct 2003
    Location
    Singapore
    Posts
    28,413
    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
    Location
    London, UK
    Posts
    894
    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.

    QuantumPete
    "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
    Location
    Seattle
    Posts
    603
    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, 03:28 PM
  2. Replies: 4
    Last Post: 06-14-2005, 05: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, 03:00 PM
  4. gcc problem
    By bjdea1 in forum Linux Programming
    Replies: 13
    Last Post: 04-29-2002, 06:51 PM
  5. Using enumerated data types
    By SXO in forum C++ Programming
    Replies: 7
    Last Post: 09-04-2001, 06:26 PM