I'm getting this error in few lines and don't know how this program would work.Begineer programmer here.Any help would be appreciated.
#include<iostream>
#include<cstring>
using namespace std;
char* find_greater(char* a,char b)
{
char* result;
if(strcmp(a,b)>0)
result=a;
else
result=b;
return result;
}
int main()
{
char str1[10],str2[10];
str1[]="zebra";
str2[]="man";
cout<<"Greater string is :"<<find_greater(str1,str2)<<endl;
return 0;
}
Aucun commentaire:
Enregistrer un commentaire