-
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
-
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
-
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.
-
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
-
By Ron Weller in forum Database
Replies: 2
Last Post: 05-12-2007, 04:11 PM
-
Replies: 0
Last Post: 03-01-2003, 08:17 AM
-
By Peter Prager (Canam Software) in forum vb.announcements
Replies: 0
Last Post: 08-15-2001, 10:48 AM
-
By benjaminkv in forum .NET
Replies: 0
Last Post: 10-26-2000, 04:04 AM
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
Forum Rules
|
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
|
Bookmarks