This function is compatible with the following targets:
|
|
#include <string.h>
int strcmp(const char *s1, const char *s2);Parameters:
Parameters for this facility are:
#include <string.h>
#include <stdio.h>
int main (void)
{
static char s1[] = "butter", s2[] = "olive oil";
char dest[20];
if (strcmp(s1, s2) < 0)
strcpy(dest, s2);
else
strcpy(dest, s1);
printf(" s1=%s\n s2=%s\n dest=%s\n", s1, s2, dest);
return 0;
}
Output:
s1=butter
s2=olive oil
dest=olive oil
[ First ] [ Previous ] [ Next ] [ Last ] [ Manuals ]
Visit the Metrowerks website at: http://www.metrowerks.com
For assistance contact Metrowerks Technical Support at: cw_support@metrowerks.com
Copyright © 2000, Metrowerks Corp. All rights reserved.
Last updated: August 16, 2000