I need to write some code that will read in some numbers in various formats. The problem is that there are a few different ways the numbers can be arranged.
n1 n2 n3
or
n1/n2 n3/n4 n5/n6
or
n1/n2/n3 n4/n5/n6 n7/n8/n9
This is relatively easy to solve with scanf but as my project is in C++ and I'm using streams everywhere else, I would like to solve this using streams as well.
I would appreciate some help on how to solve this problem. Thanks.
P.S. In case anybody is curious the above is a graphics format. We can either have 3 vertices alone, 3 vertices along with their corresponding texture coordinates, or 3 vertices along with their texture coordinates and normals.