What is the difference between access modifier, modifier and qualifier?

It's a competition exam question. and is a very important question from exam point of view. plz help me to get the answer of this question.

2 Years
Discussion Span
Last Post by mobashir20

Access modifier help in achieving Data Hiding in OOPS, it prevent the function of a program to directly access the member of a class, in C++ there r three typr of access modifire labeled as "public, private and protected"

Modifier help in modifying the predefined meaning of built-in data type and expand them to a much larger set. There are 4 data type modifiers in c++ :- "long" , "sort" , "signed" and "unsigned". These all 4 can be applied to int type,in addition "signed" and "unsigned" can be applied to char, and "long" can be applied to double.

Qualifiers add extra "Meaning/Quality" to identifier, there r three type of Qualifier:- "const", "volatile" and "restrict".
const:- Object of type const cannot be changed by your program during execution.
volatile:- It tell the compiler that a variable's value may be changed in ways not explicitly specified by the program, so its value is not stored in the register, so whenever requested system read the current value from the memory location.

restrict:- when two pointer r declared as restrict , it ask the compiler not to optimize them and treat them as two different pointer

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.