• 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. Bill gates
  2. Alan Turing
  3. Babbage
  4. None of these
اس سوال کو وضاحت کے ساتھ پڑھیں

ای میل کا مطلب کیا ہے؟
  1. Easy mail
  2. Electronic mail
  3. Electric mail
  4. Eye mail
اس سوال کو وضاحت کے ساتھ پڑھیں

ڈیٹابیس میں کالمز کو کیا کہتے ہیں؟
  1. Rows
  2. Fields
  3. Records
  4. None of these
اس سوال کو وضاحت کے ساتھ پڑھیں

کمپیوٹر سائنس کا بانی کون ہے؟
  1. Augusta Adaming
  2. Allen Turing
  3. Charles Babbage
  4. None of these
اس سوال کو وضاحت کے ساتھ پڑھیں

ٹورنگ ٹیسٹ کس سال متعارف کروایا گیا؟
  1. 1936
  2. 1945
  3. 1950
  4. None of these
اس سوال کو وضاحت کے ساتھ پڑھیں

All Rights Reserved © TestPointpk.com