C Board  

Go Back   C Board > Platform Specific Boards > Windows Programming

Reply
 
LinkBack Thread Tools Display Modes
Old 03-10-2003, 09:30 PM   #1
Registered User
 
SAMSAM's Avatar
 
Join Date: Nov 2001
Posts: 218
All u wanted to know about data types&more

this might be helpful to some.
It was to me. so enjoy.

but why LONG. when there is a signed int?they are the same
in 32 bits.

Code:

Data Types
Value Meaning 
BOOL A 32-bit field that is set to 1 to indicate TRUE, or 0 to indicate FALSE.
 
BOOLEAN An 8-bit field that is set to 1 to indicate TRUE, or 0 to indicate FALSE.
 
BYTE An 8-bit block of data.
 
CHAR An 8-bit block of data that typically contains a Windows (ANSI) character. 

DWORD A 32-bit unsigned integer (range: 0 through 4294967295 decimal). Because 
a DWORD is unsigned, its first (most significant) bit is not reserved for signing.

 
GUID A globally unique identifier. This data type exposes the GUID structure 

(documented in the Platform SDK), which contains the following:

DWORD: Contains the first eight hexadecimal digits of the GUID identifier.
 
WORD: Contains the first group of four hexadecimal digits of the GUID identifier.
 
WORD: Contains the second group of four hexadecimal digits of the GUID identifier. 

BYTE[]: An array whose first two bytes specify the third group of four
 hexadecimal digits, and whose remaining six bytes contain the 
final 12 hexadecimal digits of the GUID identifier. 
 
INT A 32-bit signed integer (range: -2147483648 through 2147483647 decimal).
 
LARGE_INTEGER A 64-bit signed integer (range: -2305843009213693952
 through 2305843009213693952 decimal).
 
LONG A 32-bit signed integer (range: -2147483648 through 2147483647 decimal). 
 
LONGLONG A 64-bit signed integer (range: -2305843009213693952 
through 2305843009213693952 decimal).
 
LONG_PTR A 32-bit signed LONG for pointer precision.
 Use when casting a pointer to a LONG to perform pointer arithmetic.
 
LPBYTE A 32-bit pointer to a BYTE. 

LPCSTR A 32-bit pointer to a null-terminated 
string of 8-bit Windows (ANSI) characters.
 
LPCWSTR A 32-bit pointer to a null-terminated string of 
16-bit Unicode characters. 

LPDWORD A 32-bit pointer to a DWORD. 

LPSTR A 32-bit pointer to a null-terminated string of 8-bit Windows (ANSI) characters. 

LPWSTR A 32-bit pointer to a null-terminated string of 16-bit Unicode characters.
 
OLD_LARGE_INTEGER A data type that exposes an OLD_LARGER_INTEGER structure, which contains the following:

ULONG: The lower four bytes.
 
LONG: The upper four bytes. 
 
PWSTR A 32-bit pointer to a null-terminated string of 16-bit Unicode characters. 

PUCHAR A 32-bit pointer to an unsigned CHAR.
 
PULONG A 32-bit pointer to a ULONG.
 
SHORT A 16-bit integer (range: -32768 through 32767 decimal).
 The first (most significant) bit is the signing bit.
 
TCHAR A character that is a WCHAR if Unicode is defined, or a CHAR otherwise.
 
TIME A 128-bit integer that represents an absolute time or a time interval.
 Times are specified in units of 100 milliseconds. This data type exposes the TIME structure, which contains the following:

ULONG: The lower four bytes. 


LONG: The upper four bytes. 
A positive value expresses an absolute time, where the base time is
 the beginning of the year 1601 A.D. in the Gregorian calendar.
 A negative value expresses a time interval relative to some base time,
 typically the current time.

 
UCHAR An 8-bit integer block of data (range: 0 through 255 decimal).
 Because a UCHAR is unsigned, its first (most significant) bit is 
not reserved for signing.

 
ULONG A 32-bit unsigned integer (range: 0 through 4294967296 decimal).
 Because a ULONG is unsigned, its first (most significant) bit is
 not reserved for signing.
 

ULONGLONG A 64-bit unsigned integer (range: 0 through to 18446744073709551616 decimal).
 Because a ULONGLONG is unsigned, its first (most significant) 
bit is not reserved for signing. 


ULONG_PTR A 32-bit pointer to a ULONG.
 
UNICODE_STRING A complex data type (documented in the Platform SDK) that consists of the following:

USHORT: The length of the wide-character string in bytes.
 
USHORT: The total size, in bytes, of memory allocated for
 the wide-character string buffer.
 
PWSTR: Pointer to a wide-character string buffer. 

 
USHORT A 16-bit unsigned integer (range: 0 through 65536 decimal).
 Because a USHORT is unsigned, its first (most significant) bit
 is not reserved for signing.

 
UTIME A 64-bit unsigned integer that represents the number of seconds
 since January 1, 1970, 00:00:00. For example, noon on January 1,
 1970, is represented as 43200. 

UUID A universally unique identifier. This data type exposes the UUID structure
 
(documented in the Platform SDK), which contains the following:

LONG: Contains the first eight hexadecimal digits of the UUID.

 
SHORT: Contains the first group of four hexadecimal digits of the UUID.
 
SHORT: Contains the second group of four hexadecimal digits of the UUID.
 
CHAR[]: An array whose first two bytes specify the third group of four hexadecimal digits, and whose remaining six bytes contain the final 12 hexadecimal digits of the UUID. 
 
VARIANT An Automation data type (documented in the Platform SDK)
 that contains any other automation data type. 

WCHAR A 16-bit Unicode character. 

wchar_t A 16-bit Unicode character for use with the MIDL compiler.
 
WORD A 16-bit unsigned integer (range: 0 through 65535 decimal). Because a WORD is unsigned, its first (most significant) bit is not reserved for signing
cheers!
SAMSAM is offline   Reply With Quote
Old 03-11-2003, 02:29 AM   #2
It's full of stars
 
adrianxw's Avatar
 
Join Date: Aug 2001
Posts: 4,833
>>> they are the same in 32 bits.

Yes, but suppose you have a 64 bit chip? Now a signed int could easily be 64 bits. Existing code expecting a 32 bit value would break. A LONG is 32 bits, full stop.
__________________
Wave upon wave of demented avengers march cheerfully out of obscurity unto the dream.
adrianxw is offline   Reply With Quote
Old 03-11-2003, 10:49 AM   #3
Registered User
 
SAMSAM's Avatar
 
Join Date: Nov 2001
Posts: 218
Now ,thats the kind of answer that would stick to my brain
for good.

short definition.
short example.

thank you.

ok with these:
BYTE An 8-bit block of data.

CHAR An 8-bit block of data that typically contains a Windows (ANSI) character.

i think , i am able to utilize them both for char type.

what is the difference?

and with this:

LPSTR A 32-bit pointer to a null-terminated string of 8-bit Windows (ANSI) characters

I have used it often but im not sure about the pointer terminology

what happens if u need a 16 bits pointer or 8 bits pointer?

thx
SAMSAM is offline   Reply With Quote
Old 03-11-2003, 10:55 AM   #4
Funniest man in this seat
 
minesweeper's Avatar
 
Join Date: Mar 2002
Posts: 801
>>what happens if u need a 16 bits pointer or 8 bits pointer?<<

A pointer contains an address not a value. That's why it's 32 bits.

Last edited by minesweeper; 03-11-2003 at 10:59 AM.
minesweeper is offline   Reply With Quote
Old 03-11-2003, 11:40 AM   #5
Code Goddess
 
Prelude's Avatar
 
Join Date: Sep 2001
Posts: 9,661
>what happens if u need a 16 bits pointer or 8 bits pointer?
If it is needed then the implementation will support it. Something like the near, far, and huge keywords that specified between 16 and 32 bit pointer types in Turbo C. If it isn't supported then chances are good that you have no need for it.

-Prelude
__________________
My best code is written with the delete key.
Prelude is offline   Reply With Quote
Old 03-11-2003, 12:13 PM   #6
Registered User
 
SAMSAM's Avatar
 
Join Date: Nov 2001
Posts: 218
If it is needed then the implementation will support it. Something like the near, far, and huge keywords .


ok i got it.
near and far i remember. huge?
SAMSAM is offline   Reply With Quote
Old 03-11-2003, 03:22 PM   #7
It's full of stars
 
adrianxw's Avatar
 
Join Date: Aug 2001
Posts: 4,833
>>> CHAR An 8-bit block of data that typically contains a Windows (ANSI) character.


As UNICODE becomes more the norm, a single character would be 16 bits, therefore.
__________________
Wave upon wave of demented avengers march cheerfully out of obscurity unto the dream.
adrianxw is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Bitmasking Problem mike_g C++ Programming 13 11-08-2007 12:24 AM
brace-enclosed error jdc18 C++ Programming 53 05-03-2007 05:49 PM
Program Crashing Pressure C Programming 3 04-18-2005 10:28 PM
Errors Rhidian C Programming 10 04-04-2005 12:22 PM
Ask about how to use startdoc(), startpage() to print data on paper imediately. ooosawaddee3 C++ Programming 1 07-31-2002 11:35 AM


All times are GMT -6. The time now is 08:24 AM.


Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.3.0 RC2

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