(C++) Declaring two variables in new line problem with solution