Answer the following questions true (T) or false (F)
1. It is legal to assign C-string variables.
2. The = sign used to give a variable an initial value in a definition,
char ch = ‘A’;
is different from the = sign in an assignment.
ch = ‘B’;
1. False
Explanation: C-string variables are arrays. It is illegal to assign arrays of any kind.
2. True
Explanation: One thing that sets C++ apart is that C++ separates initialization from assignment. The = in the first statement is initialization and the = in the second is assignment.
You might also like to view...
Reliability Monitor provides a trend analysis of your computer's system stability over time
Indicate whether the statement is true or false
Why is an Active Directory database backup that is older than the tombstone lifetime considered to be invalid?
What will be an ideal response?
What is the purpose of a CSIRT?
A. Respond to severe weather incidents with impacts that are too large for the on-duty IT staff to handle. B. Configure firewalls and routers. C. Respond to severe computer security incidents with impacts that are too small for the on-duty IT staff to handle. D. Respond to severe computer security incidents with impacts that are too large for the on-duty IT staff to handle.
Which of the following correctly declares and initializes a String object?
A. new String = Hello B. String greeting == "Hello"; C. String greeting = "Hello"; D. String new = "Hello"