28.2k views
1 vote
Which function null terminates strings for you?

A)getchar terminates
B)scanf terminates
C)Concatenate
D) None of these

User StanE
by
9.0k points

1 Answer

4 votes

Final answer:

The function that null terminates strings for you is scanf terminates.

Step-by-step explanation:

The function that null terminates strings for you is scanf terminates.
When using the scanf function in C, it automatically terminates the string for you by adding a null character at the end. This is done by scanning the input until it encounters a whitespace character.

User Vivek Kushwaha
by
8.9k points