sorting a double Array using <algorithm>
Posted: Mon May 15, 2006 11:37 am
I am facing problem in sorting a double array . Can somebody help me ?
This is the Code i wrote but its giving error
The error is Coming out to be
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