I have input string in shape of:polygons=[(4,5),(6,8),(5,3),(11.4,6);(3,8),(2,9),(1,2)],each semicolon tells me 1polygon entered user can input up to 100 polygons and 100 points in each polygon i want to store the x- coordinates of all points in 2D array how can i do that in c++? User can input any value for the points
Jump to Post
A 100x100 array of integers is only 40kbytes, so that's perfectly feasible in most environments. Just loop through the input keeping one index for the current polygon and one for the current point. Or you may be better advised to use linked lists for the polygons and the points in …
All 2 Replies
We're a friendly, industry-focused community of 1.21 million developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.