Good Dreams
Jun 5th, 2001, 03:43 PM
Is there any Real data type? I read it here. (http://161.58.186.97/showthread.php?s=&goto=lastpost&threadid=69312)
Vlatko
Jun 5th, 2001, 03:47 PM
Data Type Ranges
C/C++ recognizes the types shown in the table below.
Type Name Bytes Other Names Range of Values
int * signed,
signed int System dependent
unsigned int * unsigned System dependent
__int8 1 char,
signed char –128 to 127
__int16 2 short,
short int,
signed short int –32,768 to 32,767
__int32 4 signed,
signed int –2,147,483,648 to 2,147,483,647
__int64 8 none –9,223,372,036,854,775,808 to 9,223,372,036,854,775,807
char 1 signed char –128 to 127
unsigned char 1 none 0 to 255
short 2 short int,
signed short int –32,768 to 32,767
unsigned short 2 unsigned short int 0 to 65,535
long 4 long int,
signed long int –2,147,483,648 to 2,147,483,647
unsigned long 4 unsigned long int 0 to 4,294,967,295
enum * none Same as int
float 4 none 3.4E +/- 38 (7 digits)
double 8 none 1.7E +/- 308 (15 digits)
long double 10 none 1.2E +/- 4932 (19 digits)
Good Dreams
Jun 5th, 2001, 04:59 PM
I didn't ask for a complete list of all data types. In this case a simple yes or no would be enough.;)
As for the first question...?
parksie
Jun 5th, 2001, 05:12 PM
Real is a misnomer -- integers are real numbers as well ;) Float is correct because the decimal point "floats" around the number depending on the exponent.
struct mystruct {
int *piArray;
};
void somecode() {
mystruct xx;
x.piArray = new int[50];
delete[] x.piArray;
}
Good Dreams
Jun 6th, 2001, 05:52 AM
You're right. The thing is that I was considering more irrational numbers which are real too. I should have mentioned it.
Finally I see a practic use of pointers! I'm following the cplusplus tutorial which talks about many things, but it's kinda difficult to me to see how can I use them. In time I'll see it perhaps.
One of those things is a class. I see it like a way of organizing our code better. Am I wrong? I was watching this interesting thread started by kedaman. He mentions the use of classes to solve the problem. In which way can it be good to use a class? (in general, not only in this particular case)
http://161.58.186.97/showthread.php?s=&threadid=16754&highlight=irrational+number
Good Dreams
Jun 6th, 2001, 03:50 PM
Found a good example that shows to me a good use of classes (just closing topic).
If anyone is interested:Polynomial Class (http://turing.gcsu.edu/~gadkins1/poly.html)
Later
:)
parksie
Jun 6th, 2001, 03:52 PM
Didn't someone post that quite a while ago?
Good Dreams
Jun 6th, 2001, 03:54 PM
Yep,
Hurray for search feature!:)