How to traverse a model using c++ api?

I need to traverse a sketchup model using c++ api.
How can I do this?

You would use a for loop.

There are some examples of looping through collections and arrays here:

There are also many examples in the SDK archive in the “samples/C++” folder.
(So you need to first download the latest version [16.1] of SDK archive.)