ACTUAL QUESTIONS AND CORRECT
ANSWERS
'/0' is the special sequence character representing the null terminator character in C-String -
CORRECT ANSWER True
In C++, a C-string is a sequence of characters stored in contiguous memory area that is terminated by
a null termination character - CORRECT ANSWER True
To manipulate objects of the string class, the str() functions are used - CORRECT
ANSWER False - it is used on C-strings
The C-string array char companyname[12]; Can hold 12 characters and the null terminator character -
CORRECT ANSWER False - it is a char
White space encompassess - - CORRECT ANSWER Tab, newline, space
#include "stdafx.h"
#include<iostream>
#include<string>
Using namespace std;
Int main() {
Int p = 20;
Int *q = &p;
Cout << &q;
Return 0;
, } - CORRECT ANSWER Address of the variable q
Array names are constant pointers - CORRECT ANSWER True
The ampersand operator (&) used in the execution part of a program takes the address of a variable. -
CORRECT ANSWER True
The asterisk (*), also known as the address operator, returns the memory address of a variable when
used in execution source code. - CORRECT ANSWER False - it returns the contents, not the
memory address, also it's not an address operator
The following last 2 code statements produce the same result
Int *p, i;
*(p + i) = 2;
P[i] = 2; - CORRECT ANSWER True
#include "stdafx.h"
#include<iostream>
#include<string>
Using namespace std;
Int main() {
Int aptr[] = {1,2,3,4};
Int numelements = sizeof(aptr)/sizeof(aptr[0]);
Int *endptr = (aptr + numelements);
For (int *p = aptr; p < endptr ; p++)
Cout << *p << " ";
Return 0;
} - CORRECT ANSWER Will display 1 2 3 4