Yeah, so I've written this code to extract everything that is between "/*" and "*/". Unfortunately it doesn't work, I would be happy I someone would fix or tell me what I did wrong. Thanks in advance guys.
Generally, you do not want to increment the counter inside a for loop.
The x defined on line 12 (which is not initialized) hides the x defined on line 8 (which is initialized.) So, it's quite likely that the junk in your uninitialized x is greater than line.length() so that the body of the for loop is never entered.
With C++98, on lines 8 and 12, replace auto with std::size_t.
1 2 3 4 5 6 7
// auto beg = line.find( "/*" ) ;
std::size_t beg = line.find( "/*" ) ;
// ...
// const auto end = line.find( "*/", beg ) ;
const std::size_t end = line.find( "*/", beg ) ;