basicc++mcqRandom

C MCQ Questions and Answers on Strings, Char Arrays and Pointers 1

Table of Contents

 

Study C MCQ Questions and Answers on Strings, Character Arrays, String Pointers and Char Pointers. Easily attend technical job interviews after practising the Multiple Choice Questions.

Go through C Theory Notes on Strings before studying questions.

1) What is a String in C Language.?

A) String is a new Data Type in C

B) String is an array of Characters with null character as the last element of array.

C) String is an array of Characters with null character as the first element of array

D) String is an array of Integers with 0 as the last element of array.

Answer [=]

B

2) Choose a correct statement about C String.

char ary[]=”Hello..!”;

A) Character array, ary is a string.

B) ary has no Null character at the end

C) String size is not mentioned

D) String can not contain special characters.

Answer [=]

A

Explanation:

It is a simple way of creating a C String. You can also define it like the below. is mandatory in this version. char ary[] = {‘h’,’e’,’l’,’l’,’o’,’