Latest Answer : Yes . e.g. scanf ("%10s", str ); only 10 chars would be taken in ...
Latest Answer : When the storage is at premium , it may be necessary to pack several objects into single machine word , one common use is a set of single bit flags in application like compiler symbol tables. A bit field or field for short is a set of adjacent bits with ...
Latest Answer : Samik your explanation is nice.Easy for the beginner to understand. ...
Latest Answer : These are access specifiers for class data members and member methods.Public: The data members and methods having public as access specifier can be accessed by the class objects created outside the class.Protected: The data members and methods declared ...
Latest Answer : A friend function can access all private protected and public data of a class. A class has to declare a function or another class as a friend. Also the friendship is one way. Class A is friend of class B does not mean that class B is friend of class A. ...
If I am declaring a private member in abstract class, although it will not be accessible in derived classes and can not be accessible by instantiating the abstract class. Then what is the optimal use of declaring private member in an abstract class.
If we create a array of structures(structure must contain string field) we cannot store the data ny getting input from keyboard.Why?
How could I, in C++ declare a class point. The class point has two private data members x and y of type float. The class point has a parameterized constructor to initialize both the data members i.e. x and y. The class point has a member function display() that display the value of x and y. Create two objects p1 and p2 with your desired data and display the values of x and y of p1 and p2. Now create a third object p3 by using the expression p3=p1+p2 and display the values of x and y of p3.
Why are private fields assigned with public properties?Is this not same as declaring the field Public?