actually the problem is when storing the data.
when we try to retake the data , data is not found
this code will work but only once
constructor for a struct called rooms called constructor?
Are you trying to nest functions. This is not possible in c++. It can be approximated with functors but thats a different story.
Maybe you should totally describe what you are trying to accomplish.
There are a few problems with your code. But I think the main problem is that you are trying to use new to arrayafy (if thats a word) your pointer. This does not work. When you new something into your pointer it does not turn it into an array if something is already being pointed to by that pointer. Instead it moves the pointer to the new address of the newly allocated space and the old space is lost and you have a memory leak.
This line is your problem:
Instead you will have to use a linked list like CList.
CList <int, int> rs.roomnum;
Something like that.