Help

#include <stdio.h>
#include <string.h>

void inicaps1(char *);
char * inicaps2(char *);

char phrase[256];
char outstring[256];
int DEMO=0;
int main(int argc,char **argv)
{
if (argc>1 && strcmp(argv[1],"$")==0)
DEMO = -1;
while (gets(phrase))
{ if (DEMO)
{ inicaps2(phrase);
strcpy(outstring,inicaps2(phrase));
printf("inicaps2 OUTSTRING: %s\n",outstring);
printf("inicaps1 BEFORE : %s\n",phrase);
inicaps1(phrase);
printf("inicaps1 AFTER : %s\n",phrase);
}
else
{ inicaps1(phrase);
printf("%s\n",phrase);
}
}
I want to create a C module containing functions that can do the conversion in two different ways as described by the following function reference

void inicaps1(char *s)

char *inicaps2(char *s)

Example 1 : " GOOD MORNING" is converted to "Good Morning"
Example 2 : "good night" is converted to "Good Night"
Last edited on
Use code tags and tell us what problem your having
Topic archived. No new replies allowed.