Google
 
Webcprogramming.com




An Affiliate of AIHorizon




Solutions to Quiz 9: C-Style Strings

If you didn't do as well as you wanted to, be sure to read through Cprogramming.com's tutorial on C-style Strings. Otherwise, congratulations, you're almost halfway through the tutorials!

1. Which of the following is a static string?
A. Static String
B. "Static String"
C. 'Static String'
D. char string[100];

2. What character ends all strings?
A. '.'
B. ' '
C. '\0'
D. '\n'

3. Which of the following reads in a string named x with one hundred characters?
A fgets(x, 101, stdin);
B. fgets(x, 100, stdin);
C. readline(x, 100, '\n');
D. read(x);

4. Which of the following functions compares two strings?
A. compare();
B. stringcompare();
C. cmp();
D. strcmp();

5. Which of the following adds one string to the end of another?
A. append();
B. stringadd();
C. strcat();
D. stradd();


Quiz
Next lesson: Lesson 10, file I/O


Bookmark and Share



-----
Subscribe to cprogramming.com by Email
Interested in advertising with us?
Please read our privacy policy.
Copyright © 1997-2009 Cprogramming.com. All rights reserved.