0

distance does not name type mistake even though I suppose that I am right.
pls help

#include <cstdlib>
#include <iostream>
#include <conio.h>
#include <sstream>

// struct unit with loop inside....

using namespace std;

struct distance

{
       int mt;
       float cm;
};

struct room
{
       distance length;
       distance width;
};

int main(int argc, char *argv[])
{

room study;
float area;
study.length.mt=3;    // study room , length=330 cm  width=180cm
study.length.cm=30;    
study.width.mt=1;
study.width.cm=80;
area=(study.length.mt+study.length.cm/100)*(study.width.mt+study.width.cm/100)
cout << "area=" << area <<" m2";    //area=length*width 
   
    system("PAUSE");
    return EXIT_SUCCESS;
}
3
Contributors
2
Replies
3
Views
6 Years
Discussion Span
Last Post by burcin_erek
0

you solved this thread. I am so fool.
besides I also forget semicolon on line 32
what can I say
thank you.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.