Curioustab
Aptitude
General Knowledge
Verbal Reasoning
Computer Science
Interview
Take Free Test
Aptitude
General Knowledge
Verbal Reasoning
Computer Science
Interview
Take Free Test
References Questions
C++ return by reference: evaluate the two claims We can return a global variable by reference. 2) We cannot return a local variable by reference.
C++ references: evaluate the two claims Once a variable and a reference are linked, they remain tied. 2) After declaring one reference to a variable, another reference to the same variable is not allowed.
In C++ language fundamentals, a reference behaves most like which of the following? Choose the closest conceptual analogy used in programming pedagogy to describe a reference (while remembering that a reference is an alias, not a separate object).
In C++, which statement about references is correct? Select the rule that always applies to reference initialization and binding.
Accessing through a C++ reference: which statement is correct? Choose how you read or write the referred value via a reference.
Returning a reference from a function in C++: which reasons are valid? The returned information is a large object, so returning a reference is more efficient than copying. The function's type must be an R-value.
C++ reference reseating: which statement is correct? Choose the rule that governs whether a reference can later refer to another variable.
References in declarations: which statements are correct? An array of references is acceptable. We can create a reference to a reference.
Which statement about C++ references is correct? Select the fact that accurately reflects how references behave in real code.
Storage and placement: where is a C++ reference stored? Choose the most appropriate statement from the given options.
Which statement about C++ references is correct? Pick the most accurate description from the options provided.
C++ syntax check: a reference is declared using which symbol? Select the correct token used in declarations.
C++ references: evaluate two claims Once a reference variable has been defined to refer to a particular variable it can refer to any other variable. A reference is not a constant pointer. Choose the single best option.
C++ references: evaluate two claims A reference is not a constant pointer. A reference is automatically dereferenced when used. Choose the single best option.
C++ references: which statement about arrays of references and reseating is correct?
C++ references vs pointers: evaluate two claims Pointer to a reference and reference to a pointer are both valid. When we use a reference, we are referring to its referent (the underlying object).
C++ references: evaluate two claims Changing through a reference changes the referent (the bound object). We can create an array of references.
C++ (old iostream.h): trace the ternary, references, and side effects—what does this program output and why?\n\n#include
\nint CuriousTabFunction(int m)\n{\n m *= m;\n return ((10) * (m /= m));\n}\nint main()\n{\n int c = 9, *d = &c, e;\n int &z = e;\n e = CuriousTabFunction(c-- % 3 ? ++*d : (*d *= *d));\n z = z + e / 10;\n cout << c << " " << e;\n return 0;\n}
C++ references with enum-backed ints: after chained increments and assignments, what are p, q, and z?\n\n#include
\nenum xyz { a, b, c };\nint main()\n{\n int x = a, y = b, z = c; // 0,1,2\n int &p = x, &q = y, &r = z;\n p = z;\n p = ++q;\n q = ++p;\n z = ++q + p++; \n cout << p << " " << q << " " << z;\n return 0;\n}
C++ reference semantics (post-increment in stream): what exact output appears and why?\n\n#include
\nint main()\n{\n int x = 10;\n int &y = x;\n x++;\n cout << x << " " << y++;\n return 0;\n}
1
2
3