1.

This function offers the quickest way to determine whether two character sequences of the same known length match character for the character up to and including any null character in both.(a) strcmp()(b) memcmp()(c) strncmp()(d) no such functionThis question was addressed to me during an internship interview.The origin of the question is String Operations topic in division String Operations in C of C

Answer»

Correct answer is (c) strncmp()

For EXPLANATION: The strncmp() function is used to compare not more than n CHARACTERS (characters that follow a NULL character are not COMPARED) from the array pointed to by ONE, to the array pointed to by other.



Discussion

No Comment Found

Related InterviewSolutions