|
-
July 9th, 2012, 04:45 PM
#1
Declaring the size of int, double, floats
Code:
#include <iostream>
using namespace std;
int main()
{
int i;
float x, y, z;
double d;
i = 15;
d = 40;
x = 25;
y = 125;
z = y/x;
return 0;
}
Question to all .. I need to declare the size of my int, float(s), and the double listed above. How would I got about doing so?
For instance, my string: string str ("str");
I did it like: cout << "The size of my str is: " << str.size() << " characters." << endl;
Please help!
Last edited by Marc G; July 12th, 2012 at 01:56 AM.
Reason: Added code tags
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
|