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
    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
    21,717
    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.
    C + C++ Compiler: MinGW port of GCC
    Version Control System: Bazaar

    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
    602
    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

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