use the strcmp function to compare char-pointers.

Your program doesn't work if the '//' are not at the beginning of a line. You can read a line and then use strstr to find the substring '//'.

Another tip : see to the getline function. It's a function defined in STL. You don't have to worry anymore about the linelength. STL will do it for you. You can also use the string-implementation of STL.Of course this means you have to dig in STL and that's not always easy. A very good startpoint for this is reading the chapters of Thinking In C++, which you can find here at Codeguru.