error : binary '>>' : no operator found which takes a right-hand operand of type 'const char [1] And program crashes after taking first input

前端 未结 1 1797
无人共我
无人共我 2020-12-22 13:31

This is a simple program which takes 2 numbers, reverses them and prints their reversed sum. I have 2 problems

  1. If I keep using \"cin >> \" it gives error \"bin
相关标签:
1条回答
  • 2020-12-22 14:31

    The problem is with this line:

    cin >> num1 >> "" >> num2 ;
    

    You cannot store the value got from the input into "". I believe you wanted something like:

    cin >> num1 >> num2 ;
    
    0 讨论(0)
提交回复
热议问题