DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

+ Reply to Thread
Results 1 to 4 of 4
  1. #1
    Join Date
    Dec 2010
    Posts
    3

    Data types in C++

    Hi,

    I was wondering if anyone has ever heard of "mixed" as a data type along the lines of int, double etc? I came across this on a website. Sorry to post what you already know but I wanted to get the point across that they are saying this is a data type. I am new obviously but I found it interesting.

    char
    Character and/or small integer.
    1byte
    -128 to 127(unsigned: 0 to 255)

    int
    Integer
    4bytes
    -2147483648 to 2147483647(unsigned:0 to 4294967295)

    bool
    Boolean value, can take two values "True" or "False
    1byte
    True or False

    float
    Floating point number
    4bytes
    3.4e +/- 38 (7 digits)

    wchar_t
    Wide character
    2bytes
    1 wide character

    mixed
    Any type
    Unknown
    Unknown



    Thank you,

    Lynnajoe

  2. #2
    Join Date
    Nov 2003
    Posts
    4,118
    No, mixed is not a standard built-in type. It's most likely a union that represents a variant, that is an unspecified piece of memory whose exact type is determined at runtime based on a type-field or some other form of encoding.
    Danny Kalev

  3. #3
    Join Date
    Dec 2010
    Posts
    3

    Thank you

    Hi,

    Thank you. I was wondering because they had it grouped with the other data types as if it was the same. I tried it and I believe you are correct that it is a union. The information was very misleading.

  4. #4
    Join Date
    Dec 2007
    Posts
    401
    The information was very misleading.
    It is also misleading (wrong) when it specifies the precise sizes and ranges of intrinsic data types; for example:
    int
    Integer
    4bytes
    -2147483648 to 2147483647(unsigned:0 to 4294967295)
    The C++ standard does not specify the exact sizes or ranges of the intrinsic data types. (Only their relative sizes are specified.) The set of generic fundamental types have implementation-defined limits (with minimum guarantees). The size and range of the basic types can be accessed via std::numeric_limits<> in the header <limits>. For example, a byte could be 32 bits (or more), and each of char, short, int, and long could be one byte. (A byte isn't necessarily an octet; it is of the same size as a char.)

    With C++0x, the standard header <cstdint> (<boost/cstdint.hpp> can be used for for C++98), the library additionally provides a set of fixed-sized integral types (for example std::int32_t).

Similar Threads

  1. Replies: 2
    Last Post: 05-12-2007, 04:11 PM
  2. Replies: 0
    Last Post: 03-01-2003, 08:17 AM
  3. Turbo Data: test data generator (www.turbodata.ca)
    By Peter Prager (Canam Software) in forum vb.announcements
    Replies: 0
    Last Post: 08-15-2001, 10:48 AM
  4. Future proofing data types.
    By benjaminkv in forum .NET
    Replies: 0
    Last Post: 10-26-2000, 04:04 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


Top DevX Stories

Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL


Sponsored Links