logo

Crowdly

Browser

Add to Chrome

The following code: char* myreader(int fd){      int cmp = 0;     char c;...

✅ The verified answer to this question is available below. Our community-reviewed solutions help you understand the material better.

The following code:

char* myreader(int fd){ 

    int cmp = 0;

    char c;

    while(read(fd, &c, 1) == 1 && c!= '\n') cmp++;

    char *ch = (char*) malloc (cmp+1);

    lseek(fd, 0, SEEK_SET);

    read(fd, ch, cmp);

    ch[cmp] = 0;

    return ch;

}

0%
0%
0%
0%
More questions like this

Want instant access to all verified answers on efreussite.fr?

Get Unlimited Answers To Exam Questions - Install Crowdly Extension Now!

Browser

Add to Chrome