C++ Programming Fundamentals
Test your knowledge of C++ programming concepts including operator overloading, constructors, STL, access specifiers, and basic C/C++ syntax.
Questions
main() { char s1[]=“Cisco”; char s2[]= “systems”; printf(“%s”,s1); }
- systems
- Cisco
- Null
- error
#define TRUE 0 // some code while(TRUE) { // some code }
- infinite loop
- Error
- This will not go into the loop as TRUE is defined as 0.
- 0
main() { int x=10, y=15; x = x++; y = ++y; printf(“%d %dn”,x,y); }
- 10,16
- 11,15
- 10,15
- 11,16
main() { int a=0; if(a==0) printf(“Cisco Systemsn”); printf(“Cisco Systemsn”); }
- Two lines with “Cisco Systems” will be printed.
- Compile error
- run time error
- Cisco Systemsn
Which of the following languages is a subset of C++ language?
- C language
- Java Language
- C# language
- B language
Which of the following correctly describes C++ language?
- Statically typed language
- Dynamically typed language
- Both Statically and dynamically typed language
- Type-less language
Which of the following keyword supports dynamic method resolution?
- Abstract
- Virtual
- Dynamic
- Typeid
Which of the following language is not supported by C++?
- Exception Handling
- Reflection
- Operator Overloading
- Namespaces
Which of the following language feature is not an access specifier in C++?
- Public
- Private
- Protected
- Internal
If X is the name of the class, what is the correct way to declare copy constructor of X?
- X(X arg)
- X(X* arg)
- X(const X* arg)
- X(const X& arg)
What does STL stand for?
- Simple Template Library
- Standard Template Library
- Static Type Library
- Single Type-based Library
Which of the following is the most common way of implementing C++?
- C++ programs are directly compiled into native code by a compiler
- C++ programs are first compiled to intermediate code by a compiler and then executed by a virtual machine
- C++ programs are interpreted by an interpreter
- A C++ editor directly compiles and executes the program
What is the implicit pointer that is passed as the first argument for nonstatic member functions?
- ‘self’ pointer
- std::auto_ptr pointer
- ‘Myself’ pointer
- ‘this’ pointer
Which of the following operator cannot be overloaded?
- = (assignment operator)
- == (equality operator)
- –> (row operator)
- :: (scope resolution operator)