A member of a structure or of a class is accessed using the

A member of a structure or of a class is accessed using the The dot operator Comma operator The indexing operator The ampersand operator A C++ structure, or struct, like the C++ array, is a homogeneous data structure. (i.e., all data is of the same type) True False A structure can have a member whose type is another structure. True False There is no access to private members of a class by any function defined outside the class. True False The dot operator is used between an object and a data member or between a calling object and a call to a member function. True False

Solution

Dear Student,

Here are the answers...

Answer: 1: Option A is correct.

A member of a structure or of a class is accessed using the dot operator(.).

Ex:

struct student

{

int ID;

}Stu1;

here student is the structure and ID is the member, so ID of the student will be accessed in the main function as below.

Stu1.ID;

Answer: 2: False

A C++ structure may contain different data types while a C++ array contains similar data types.

Answer: 3 True

Nesed structures have a member whose type is another structure.

Answer: 4 True

(No outside Access is allowed.)

Yes there is no access to private members of a class by any function defined outside the class.

\"If you want to access the private member, you can declare a function/class as friend of that particular class, and then the member will be accessible inside that function or class object without access specifier check.\"

Answer:5 False

The dot operator is used between an object and a data memebr, not between a calling object and a call to member function.

Ex: emp.name ( here emp is an object and name is the data member )

To access the member functions scope resolution operator [::] is used.

Kindly Check and Verify Thanks...!!!


Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site