This is the Code i wrote but its giving error
Code: Select all
#include<iostream>
#include<algorithm>
#include<stdlib.h>
using namespace std;
int Comparison(const char *s1 , const char *s2)
{
if(strcmp(s1,s2)>1)
return 1;
else
return 0;
}
int main(void)
{
char *s[2];
s[0] = "Ankur";
s[1] = "Handa";
sort(s,2,Comparison);
for(int i=0;i<=1;i++)
printf(" %s\n",s[i]);
return 0;
}
The error is Coming out to be
Code: Select all
sortArrayofPointers.cpp: In function