k i need to know all the diffrent data types
like short int ,int ect and signed, unsigned and how far they go in value .im use to vb and asm declarations of these but i dont know about c++ ones.
do you have a list or can you type em up for me?
Printable View
k i need to know all the diffrent data types
like short int ,int ect and signed, unsigned and how far they go in value .im use to vb and asm declarations of these but i dont know about c++ ones.
do you have a list or can you type em up for me?
There are no unsigned floating point numbers.Code:VB C++
--------
Long long, int longword signed 231 -1
unsigned 232
integer short you lose one bit for signed
216
byte char 0-255 unsigned -127 - 127 signed
single float same ranges as in VB
double double same
All datatypes are supported as pointers.
The ranges are not quite right:
C++: long
signed: -2^31 to (2^31)-1
unsigned; 0 to 2^32
short:
signed: -2^15 to (2^15)-1
unsigned 0 to 2^16
char:
signed: -128 to 127
unsigned: 0 to 255
You don't lose bits when it's signed, but the highest bit is used for sign. But I suppose I don't need to tell you what one's complement is...
what about 8 bytes(currency)? and tbyte(ten byte floating point/real10)
_int64 is VC++'s 64 bit (8 byte) data point. The C++ standard says this type is called long long int. The range is signed -2^63 to (2^63)-1 and unsigned 0 to 2^64.
Currency is not a native data type of C++, it is usually represented by a simple 64 bit integer (don't know whether signed or unsigned).
10 byte (80 bit) floats are no native data type of Standard C++ either. The x86 floating point unit can't handle those, so if a C++ dialect supports them (there are a few compilers, but not VC++) it needs to emulate this function.
Compilers for other systems might offer native support for them.
ten byte floats are native to the x87 fpu, i have used them amlost always in assembly programming.
btw whats the command directive to add assembly code to my program?
add assembly to C++ code:
_asm
{
//assembly stuff here!
}
Really?
Interesting....
Most compilers support this syntax:
asm op arg;
asm op arg1, arg2;
or
asm {
op arg
op arg1, arg2
}
VC++ requires _asm instead of asm.
The C++ standard says this syntax must be supported, but it isn't on most compilers (I think gcc3 supports it)
asm("op arg");
asm("op arg1, arg2");
It's stupid anyway...