Which of the following is used to define the members of a class externally in…

2023

Which of the following is used to define the members of a class externally in C++?

  1. A.

    :

  2. B.

    ::

  3. C.

    #

  4. D.

    More than one of the above

  5. E.

    None of the above

Attempted by 167 students.

Show answer & explanation

Correct answer: B

In C++, the scope resolution operator (::) is used to define class member functions outside the class definition. This allows the function body to be written separately from the class declaration. The colon (:) is used in constructors for member initialization, not for defining members externally. The hash symbol (#) is used for preprocessor directives like #include and #define, not for defining class members. Therefore, only the scope resolution operator is used for external definition of class members.

Explore the full course: Uppsc Polytechnic Lecturer 2025 Cs