/Users/danielkopetskiy/CLionProjects/untitled97/main.cpp:7:20: error: no viable conversion from 'int' to 'std::string' (aka 'basic_string<char, char_traits<char>, allocator<char> >')
std::string str = x;
^ ~
/Users/danielkopetskiy/CLionProjects/untitled97/main.cpp:18:5: note: in instantiation of function template specialization 'func<int>' requested here
func(2, 2);
^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/string:799:5: note: candidate constructor not viable: no known conversion from 'int' to 'const std::__1::basic_string<char> &' for 1st argument
basic_string(const basic_string& __str);
^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/string:804:5: note: candidate constructor not viable: no known conversion from 'int' to 'std::__1::basic_string<char> &&' for 1st argument
basic_string(basic_string&& __str)
^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/string:817:5: note: candidate constructor template not viable: no known conversion from 'int' to 'const char *' for 1st argument
basic_string(const _CharT* __s) {
^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/string:867:5: note: candidate constructor not viable: no known conversion from 'int' to 'initializer_list<char>' for 1st argument
basic_string(initializer_list<_CharT> __il);
^
void swap(int* a, int* b) {
int temp;
temp = *a;
*a = *b;
*b = temp;
}
int main() {
int n = 2;
int arr[n][n];
for (int i = 0; i < n; ++i) {
for (int j = 0; j < n; ++j) {
scanf("%d", &arr[i][j]);
}
}
swap(arr, arr + 1);