Question:Which of the following function is correct that finds the length of a string? 

A 
int xstrlen(char *s)
{
    int length=0;
    while(*s!='\0')
    {    length++; s++; }
    return (length);
}
 

B 
int xstrlen(char s)
{
    int length=0;
    while(*s!='\0')
        length++; s++;
    return (length);
}
 

C 
int xstrlen(char *s)
{
    int length=0;
    while(*s!='\0')
        length++;
    return (length);
}
 

D 
int xstrlen(char *s)
{
    int length=0;
    while(*s!='\0')
        s++;
    return (length);
}
 

+ Answer
+ Explanation
+ Report
Total Preview: 1424

Copyright © 2024. Powered by Intellect Software Ltd