LearnFrenzy
Sign in Take a free test

Strings · Exercise 1 of 4

Strings String Basics MCQ

  • 12 questions
  • Page 2 of 2
  • Answers explained
0Attempted
0Correct
0Wrong
Directions

Twelve multiple-choice questions on how C strings work: the terminator, literals vs arrays, safe input, string.h, ctype, UTF-8 and C23. Pick an option to check your answer instantly.

Question 11 Medium

Which statement about strdup() is true?

A It became part of standard C in C23 (before that it was POSIX)
B It has been standard C since C89
C It copies into a buffer you pass in
D It needs no free()
Question page & discussion
Question 12 Easy

What does a == b compare when a and b are strings?

A The characters of both strings
B Their lengths
C Their addresses
D Their first characters
Question page & discussion
Up next · Exercise 2Predict the Output12 questions

Ready to test your Programming?

Timed online tests with instant scores and explanations.

Search LearnFrenzy

Esc

Quick links