Is my main function correct?
I have to split(s,c,sl,sr)-splits a string s into two substrings sl and sr. Sl is the portion of the string to the left of c and sr is the portion following c. If the string does not contain c, sl is a copy of s and sr is empty string. This is a utility function called by other functions. It returns true if c is found in s, otherwise it returns false. S and c are input parameters, and sl and sr are output parameters. Assuming that all parameters are strings.
Code:
split(char s; char c; char sl; char sr)
int main(void)
{
int i = 0;
char sl, sr, s, c;
char *chptr, name, value;
char sentence[15][80], a[10], b[100];
printf("Please enter a URL.");
fgets(sentence, 80, stdin);
for(chptr = sentence; *chptr != '\n'; chptr++);
*chptr = '\0';
while(i>7)
{
sentence[i] = a[i];
i++;
}
if(strcmp(a[i], "http://"))
{
exit(0);
}
while(sentence[i] != b[i])
{
sentence[i] = b[i];
i++;
}
printf("The domain name:", b[i]);
I'm new to "C" programming so I don't know clearly what I'm doing.