C++ supports a large number of data types. Thus built in or basic data types supported by c++ are integer, floating point and character type. A brief discussion on these three data types. 1. BUILET-IN DATA TYPES A. Integer data types (int):– it accepts numeric data such as numbers. Short Long Unsigned B. Floating point […]
A member of a class that can be redefined in its derived classes is known as a virtual member. In order to declare a member of a class as virtual, we must precede its declaration with the keyword virtual. When a function is made virtual, C++ determines which function to be used at runtime based […]
C++ defines some format flags for standard input and output, which can be manipulated with the flags, setf, and unsetf functions. For example, cout.setf(ios_base::left, ios_base::adjustfield); void stream::unsetf(fmtflags flags); The function unsetf() uses flags to clear the io_stream_format_flags associated with the current stream. #include <iostream.h> main() { ios_base::fmtflags original_flags = cout.flags(); cout<< 812<<‘|’; cout.setf(ios_base::left,ios_base::adjustfield); cout.width(10); cout<< […]