Making endless grid

I want to make a grid of objects. I know how to use an array such as int grid[5][4], but I want to be able to insert an object at any point in the grid so I am planning on using a set. How would I make a grid-ish set of an object named Page?
You need to be much more specific about what you are trying to do.

When you say, "I want to be able to insert an object at any point," what exactly do you mean? Is the grid supposed to change size? What is a "Page"?
I want to make a word processing / spreadsheet app, where you would have the pages in a grid. I want to have my pages span so that I can have a spreadsheet, presentation, drawing, and word processing all in one app/window.

Thus I want to do two things:
[A][B][C]
[1]
[2]
[3]
If the above was a table, I want to be able to insert a row/column in between a previous row/column.

Similarly, because the tables may be contained within the pages. I will need to add a page to expand the table.

Also, if the user were doing a drawing, he should be able to right click between 2 pages and insert a new page. On the screen, I do not want the pages to be restricted to only expanding vertically or only horizontally.
Use a nested vector or deque.
You'll need special code to insert the outer dimension.
I've got to go now.
If I understand you correctly, are you saying that I would have each column of pages be a vector or deque and then I would have another vector to contain all those vectors or deques?

(I haven't looked into whether I want vector or deque, but why wouldn't I want set?)
Yes, you understand right.
A set is used for storing unique items -- so there is no fixed index association for the items in a set.
Topic archived. No new replies allowed.