Originally Posted by
twazzler
You've lost me, sorry...
Like this... with a minor revision for the newline from fgets...
Code:
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#define MAX 100
void reverse (char s[]);
int main (int argc, char *argv[])
{
char mystring[MAX];
do
{
printf("Please enter a string of characters.\nEnter quit when done.\n");
fgets(mystring,MAX,stdin);
reverse(mystring);
} while (_stricmp(mystring,"QUIT\n"));
return 0;
}
void reverse (char mystring[])
{
int x;
x=strlen(mystring);
for(x=strlen(mystring); x>=0; x--)
{
printf("%c", mystring[x]);
}
printf("\n");
}
Now... open the Pelles C help file click the index tab ... type in stricmp and press Enter.
Next put the flashing text cursor on the word stricmp and press F1 ...
Pelles C is probably the best documented compiler and library I've ever seen.