CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 5 of 5

Threaded View

  1. #1
    Join Date
    Jul 2012
    Posts
    4

    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
  •  





Click Here to Expand Forum to Full Width

Featured