class building
  { public:
      int length, width, height;
      string purpose;
      string name;

    private:
      float volume;
      int num_windows;
  };

building office;

void main ()
 {  // The following statements are legal:
    office.name = "Bleedem, Woffle & Scarper (Lawyers)";
    office.height = 34;

	cout <<"height is"<< office.height <<endl;
	cout << " name is " << office.name<<endl;
}

what is the wrong with this .. the problum is hapening when showing the valu on name.(cout << " name" << office.name<<endl;)

no probs guysss...i made it,
the prob is with
#include <string> header file

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.