I simply typed in "read ext2 under windows" in the clusty.com search engine and got this right away: ext2ifs and explore2fs are the main programs that exist for the purpose, though there are others.
This sounds very much like a homework assignment, so I would be breaking the forum rules to just give you the code -even if I had it under my nose. I personally have no interest in the matter, but was willing to point you in a gerneral direction which might help you. Don't be too rude, or I'll lose even that motivation!
Downloading the sources for either one of the above mentioned programs should give you a good start on figuring out what code you need to complete your assignment -if either is written in C++. If not, do your own search using the string quoted above and you'll find still more programs whcih do *part* pf what you want.
This forum is an excellent place to get help with specific problems -usually once you have some code started. But you'll get stonewalled if you are rude or try to get forum memebers to respond to your 'urgent' deadline -especially if it is a homework assignment -it is against the forum rules to do the work for you, even if someone is able to.