adplus-dvertising
frame-decoration

Question

Which of the following creates a String named constant called partNo, whose value is AB45?

a.

const char[4] partNo = "AB45";

b.

const char[5] partNo = 'AB45';

c.

const char[5] partNo = "AB45";

d.

const char partNo[5] = "AB45";

Answer: (d).const char partNo[5] = "AB45";

Engage with the Community - Add Your Comment

Confused About the Answer? Ask for Details Here.

Know the Explanation? Add it Here.

Q. Which of the following creates a String named constant called partNo, whose value is AB45?

Similar Questions

Discover Related MCQs

Q. The function strcmp("Jose", "JOSE") will return _____

Q. The standard output stream, which refers to the computer screen, is called

Q. Which of the following is a string literal constant?

Q. Which is an instantiation of the basic_string class template?

Q. Which character is used to terminate the string?

Q. How does the strings are stored in the memory?

Q. Where are the strings stored?

Q. What will happen if a string is empty?

Q. Which header file is used to manipulate the string?

Q. How many maximum number of parameters does a string constructor can take?

Q. Which constant member functions does not modify the string?

Q. What is the difference between unsigned int length() and unsigned int size()?

Q. How many parameters can a resize method take?

Q. Where are standard C libraries defined in C++?

Q. Which of the following have their changes in their declaration related to constness of parameter?

Q. How many elements does a floating point number is composed of?

Q. How does the limits.h header file can be represented in C++?

Q. Pick out the correct syntax of the header file that can be used with C++.

Q. How many groups of output of operation are there in c++?

Q. Pick out the correct objects about the instantiation of output stream.