Which lines contain errors?
#include <iostream>
using namespace std;

template <class X, class Y> void f(X,Y) {
    cout<<"Ok"<<endl;
}
void main(void) { 
    f(1,1);                 //1
    f<int ,int>('c', 1);    //2
    f<string>("str",1.1);   //3
}
Explanation
For lines // 1 and // 3, the data type in the function is automatically determined by the compiler based on the types of function parameters. For line // 2, char is converted to int

Следи за CodeGalaxy

Мобильное приложение Beta

Get it on Google Play
Обратная Связь
Cosmo
Зарегистрируйся сейчас
или Подпишись на будущие тесты