• Call Us : 03082533000 (WhatsApp)
  • Email Us : TestPointpk.com@gmail.com
Sticky Note
What is the main purpose of a namespace in C++?
  1. To store variables
  2. To group identifiers and avoid name conflicts
  3. To create new functions
  4. To allocate memory
Explanation
  • A namespace in C++ is used to organize code into logical groups.
  • It helps avoid name conflicts when different parts of code use the same names.
  • For example, two libraries can have functions with the same name but in different namespaces.
  • The std namespace (e.g., std::cout) is a common example.
  • Namespaces improve code clarity and maintainability.

Related MCQs

  1. 5
  2. 8
  3. SyntaxError
  4. None of these
اس سوال کو وضاحت کے ساتھ پڑھیں

حروف، اعداد اور خاص علامات پر مشتمل پاس ورڈ زیادہ مضبوط کیوں سمجھا جاتا ہے؟
  1. It reduces password length
  2. It increases possible combinations
  3. It is easier to remember
  4. None of these
اس سوال کو وضاحت کے ساتھ پڑھیں

  1. Input → Processing → Output → Storage
  2. Processing → Input → Storage → Output
  3. Storage → Input → Processing → Output
  4. None of these
اس سوال کو وضاحت کے ساتھ پڑھیں

ڈبل انڈر لائن کے لیے شارٹ کٹ کی کیا ہے؟
  1. Ctrl + Shift + D
  2. Ctrl + Ctrl + Shift + B
  3. Ctrl + Ctrl + Shift + U
  4. None of these
اس سوال کو وضاحت کے ساتھ پڑھیں

سنٹرل پروسیسنگ یونٹ کس کام کا ذمہ دار ہے؟
  1. Processing instructions and calculations
  2. Displaying images and associated text
  3. Typing input for processing
  4. None of these
اس سوال کو وضاحت کے ساتھ پڑھیں

All Rights Reserved © TestPointpk.com