The correct answer is A. public and private.
Public access specifiers allow access to the member from
213.5V175.2l142.7 81.2-142.7 81.2z"/> Subscribe on YouTube
The correct answer is A. public and private.
Public access specifiers allow access to the member from
213.5V175.2l142.7 81.2-142.7 81.2z"/> Subscribe on YouTubeOption B, int and double, are data types. Option C, formal and informal, are not access specifiers. Option D, void and free, are keywords in C++.
Here is a simple example of how public and private access specifiers are used in C++:
“`c++
class Person {
public:
string name;
int age;
private:
string address;
};
int main() {
Person p1;
p1.name = “John Doe”;
p1.age = 30;
// p1.address = “123 Main Street”; // Error: address is private
return 0;
}
“`
In the above example, the name and age of the person are accessible from anywhere in the program, but the address is only accessible from within the Person class.