|
-
Oct 1st, 2002, 09:06 PM
#1
Thread Starter
Hyperactive Member
C++ newbie, but asm and vb guru needs help!
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?
I know a lot oF Vb, expert in C++, and i think in assembly.
MSVC++6.NET
vb6
masm
Windowz Xp
I find my self using this a lot in C++
__asm {
}
-
Oct 1st, 2002, 09:39 PM
#2
Frenzied Member
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
There are no unsigned floating point numbers.
All datatypes are supported as pointers.
-
Oct 2nd, 2002, 08:56 AM
#3
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...
All the buzzt
 CornedBee
"Writing specifications is like writing a novel. Writing code is like writing poetry."
- Anonymous, published by Raymond Chen
Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.
-
Oct 2nd, 2002, 03:24 PM
#4
Thread Starter
Hyperactive Member
what about 8 bytes(currency)? and tbyte(ten byte floating point/real10)
I know a lot oF Vb, expert in C++, and i think in assembly.
MSVC++6.NET
vb6
masm
Windowz Xp
I find my self using this a lot in C++
__asm {
}
-
Oct 2nd, 2002, 03:56 PM
#5
_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.
All the buzzt
 CornedBee
"Writing specifications is like writing a novel. Writing code is like writing poetry."
- Anonymous, published by Raymond Chen
Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.
-
Oct 2nd, 2002, 04:24 PM
#6
Thread Starter
Hyperactive Member
ten byte floats are native to the x87 fpu, i have used them amlost always in assembly programming.
I know a lot oF Vb, expert in C++, and i think in assembly.
MSVC++6.NET
vb6
masm
Windowz Xp
I find my self using this a lot in C++
__asm {
}
-
Oct 2nd, 2002, 04:25 PM
#7
Thread Starter
Hyperactive Member
btw whats the command directive to add assembly code to my program?
I know a lot oF Vb, expert in C++, and i think in assembly.
MSVC++6.NET
vb6
masm
Windowz Xp
I find my self using this a lot in C++
__asm {
}
-
Oct 2nd, 2002, 06:53 PM
#8
Hyperactive Member
add assembly to C++ code:
_asm
{
//assembly stuff here!
}
-
Oct 3rd, 2002, 04:14 AM
#9
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...
All the buzzt
 CornedBee
"Writing specifications is like writing a novel. Writing code is like writing poetry."
- Anonymous, published by Raymond Chen
Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.
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
|
Click Here to Expand Forum to Full Width
|