prog.cpp: In function ‘int main()’:
prog.cpp:20:26: error: cannot convert ‘std::__cxx11::string’ {aka ‘std::__cxx11::basic_string<char>’} to ‘const char*’
if(strcmp(str[i],str[j])>0)
~~~~~^
In file included from /usr/include/c++/8/cstring:42,
from /usr/include/x86_64-linux-gnu/c++/8/bits/stdc++.h:48,
from prog.cpp:1:
/usr/include/string.h:136:32: note: initializing argument 1 of ‘int strcmp(const char*, const char*)’
extern int strcmp (const char *__s1, const char *__s2)
~~~~~~~~~~~~^~~~
prog.cpp:22:13: error: cannot convert ‘std::__cxx11::string’ {aka ‘std::__cxx11::basic_string<char>’} to ‘char*’
strcpy(temp,str[i]);
^~~~
In file included from /usr/include/features.h:446,
from /usr/include/x86_64-linux-gnu/c++/8/bits/os_defines.h:39,
from /usr/include/x86_64-linux-gnu/c++/8/bits/c++config.h:508,
from /usr/include/c++/8/cassert:43,
from /usr/include/x86_64-linux-gnu/c++/8/bits/stdc++.h:33,
from prog.cpp:1:
/usr/include/x86_64-linux-gnu/bits/string_fortified.h:88:1: note: initializing argument 1 of ‘char* strcpy(char*, const char*)’
__NTH (strcpy (char *__restrict __dest, const char *__restrict __src))
^~~~~
prog.cpp:23:18: error: cannot convert ‘std::__cxx11::string’ {aka ‘std::__cxx11::basic_string<char>’} to ‘char*’
strcpy(str[i],str[j]);
~~~~~^
In file included from /usr/include/features.h:446,
from /usr/include/x86_64-linux-gnu/c++/8/bits/os_defines.h:39,
from /usr/include/x86_64-linux-gnu/c++/8/bits/c++config.h:508,
from /usr/include/c++/8/cassert:43,
from /usr/include/x86_64-linux-gnu/c++/8/bits/stdc++.h:33,
from prog.cpp:1:
/usr/include/x86_64-linux-gnu/bits/string_fortified.h:88:1: note: initializing argument 1 of ‘char* strcpy(char*, const char*)’
__NTH (strcpy (char *__restrict __dest, const char *__restrict __src))
^~~~~
prog.cpp:24:18: error: cannot convert ‘std::__cxx11::string’ {aka ‘std::__cxx11::basic_string<char>’} to ‘char*’
strcpy(str[j],temp);
~~~~~^
In file included from /usr/include/features.h:446,
from /usr/include/x86_64-linux-gnu/c++/8/bits/os_defines.h:39,
from /usr/include/x86_64-linux-gnu/c++/8/bits/c++config.h:508,
from /usr/include/c++/8/cassert:43,
from /usr/include/x86_64-linux-gnu/c++/8/bits/stdc++.h:33,
from prog.cpp:1:
/usr/include/x86_64-linux-gnu/bits/string_fortified.h:88:1: note: initializing argument 1 of ‘char* strcpy(char*, const char*)’
__NTH (strcpy (char *__restrict __dest, const char *__restrict __src))
^~~~~