You're not clear. Runs one line? Which line? What do you mean, stops?

Your for loop does nothing but count. That's an invisibly short delay. Is the cout working?