Top

Discussion

Point out the error in the following program.

#include
#include

int main()
{
    char str1[] = "Learn through Compscibits\0.com",  str2[120];
    char *p;
    p = (char*) memccpy(str2, str1, 'i', strlen(str1));
    *p = '\0';
    printf("%s", str2);
    return 0;
}

 

  • A.Error: in memccpy statement
  • B.Error: invalid pointer conversion
  • C.Error: invalid variable declaration
  • D.No error and prints "Learn through Comp"

Answer: D

No answer description available for this question.

No comment is present. Be the first to comment.
Loading…

Post your comment