input idea

if one has an input of this shape string s = { { } { { } } { { } { { } } } }
how do you input it such that {} get stored in vector as one element, the following element is {{}}, third is {{}{{}}}
Well after the initial {

For each {, increment a counter.
For each }, decrement the counter.

When the counter is 0, you've found a sub-string.
Topic archived. No new replies allowed.