why is it that <conio.h> doesn't work sometimes and using namespace std work in c++ -


i trying code @ hackerrank isn't working.

#include<iostream> using namespace std;  int add(int b, int c) {     return b+c; }  int main() {     int a,b,c,i,sum;     cin>>a;     for(i=1;i<=a;i++)      {         std::cin>>b>>" ">>c;          sum=add(b,c);         cout<<sum<<"\n";     }     return 0; } 

error:

error : !cannot bind 'std::basic_istream::__istream_type {aka std::basic_istream}' lvalue 'std::basic_istream&&' 

you cannot this

std::cin >> b >> " " >> c;  

you trying input value b , c fine, makes no sense

std::cin >> " " 

that line should be

std::cin >> b >> c;  

Comments

Popular posts from this blog

powershell Start-Process exit code -1073741502 when used with Credential from a windows service environment -

twig - Using Twigbridge in a Laravel 5.1 Package -

c# - LINQ join Entities from HashSet's, Join vs Dictionary vs HashSet performance -