top of page

C++ Basics : Points to Remember

Pankaj Maurya

Points to remember………….!

Go through it very thoroughly ………..!

1. The speed of a computer is usually expressed in cycles per second. Typical machines operate at 100 to 200 megahertz or 100 million cycles per second.

2. Computers use the binary number system. A binary digit is called a bit.

3. A computer's basic unit of storage is a byte or 8 bits.

4. Negative numbers are usually stored in two’s complement representation. In this representation, an n-bit number can represent the values in the range –2n-1 through 2n-1 –1.

5. The central processing unit is the brain of a computer. It is where arithmetic and logical functions are performed.

6. The size of a computer’s random access memory or RAM is measured in megabytes (MB).

7. The capacity of hard disks found on current desktop machines ranges from 0.5 to 4.3 gigabytes(GB).

8. The programming language is a language that gives commands or instructions to the computer.

9. A compiler translates a programming language into machine language. A machine language consists of primitive operations that a computer can perform directly.

10. Application software solves a particular problem or provides a specific service.

11. System software supports the development and execution of other programs.

12. An operating system is system software that supports the development and execution of other programs.

13. An operating system is system software that controls and manages the computing resources such as the memory, the input and output devices, and the CPU.

14. Information is stored on a disk in a hierarchy of files so it can be found and retrieved quickly.

15. An algorithm is a detailed, step-by-step description of how to perform some task.

16. The SW Engineer's goal is to produce reliable, understandable, cost-effective, adaptable, and reusable software.

17. Abstraction isolates an object's essential, inherent aspects while ignoring nonessential or irrelevant details.

18. Encapsulation or information hiding is the process of separating the external aspects of an object, which can be viewed or accessed by other things, from the internal implementation details, which should be hidden from other objects.

19. Modularity is dividing an object into smaller pieces so each smaller object or module can be dealt with individually.

20. An inheritance hierarchy is a way of organizing a set of abstractions from most general to least general.

21. Object–oriented design and programming is a paradigm of programming in which a software system is modeled as a set of objects that interact with each other.

22. In C++, an abstraction is formed by creating a class. A class encapsulates the properties and behaviours of an object.

23. A class's data members are a class's properties or attributes.

24. A class's member functions are a course's behaviors.

25. A base class is one from which other, more specialized courses can be derived.

26. A derived class inherits properties from a base class.

27. Polymorphism is the capability of something to assume different forms. In an object-oriented language, polymorphism is provided by allowing a message or member function to mean other things depending on the type of object that receives the message.

28. Instantiation is creating a concrete object from the class abstraction.

29. The statement #include <iostream.h> is a preprocessor directive that provides the necessary definitions so that a program can input and output using the iostream library.

30. The statement using namespace std makes the objects defined in the namespace std available for use. The iostream objects (cin and cout) are defined in the namespace.

31. The c++ operator << is called insert operator. It is used to insert text into an output stream.

32. The output stream cout corresponds typically to the display.

33. The c++ operator >> is called the extraction operator. It is used to extract characters from an input stream.

34. The input stream cin normally corresponds to the keyboard.

35. The manipulator endl inserts a new line in the output stream. In addition, it forces all the output that has been sent to the stream to be written to the corresponding device.

36. Standard C++ programs begin executing in function main(). Function main() returns an integer value that indicates whether the programs executed successfully or not . The value 0 indicates successful execution of the program.

37. A value is returned from a function using the return statement. The statement return 0 returns the value 0.

38. A C++-style comment begins with // and continues to the end of the line.

39. The assignment operator = assigns or gives a new value to an object.

40. The C++ object types short, int, and long hold integer values .On PC, the short is stored in 8 bits ,an int in 16 bits and a long in 32 bits.

41. The C++ object type char holds a character. For most machines, characters are encoded using the ASCII character set.

42. The C++ object types, float, double and long double hold real values. On the PC, a long is stored in 32 bits, and a double is stored in 64 bits. On most PCs, a long double is the same size as a double, but on other machines, it can be larger.

43. A C++ string constant is a sequence of characters enclosed in double quotes. Special characters such as the newline, tab, and bell can be included in a string constant using special escape characters.

44. A C++ integer constant can be written in one of the three bases: octal, decimal, or hexadecimal. An octal integer constant begins with a zero digit. Thus, the constant 040 is octal and represents the decimal value 32.Decimal constants begin with a digit other than zero, and hexadecimal constants begin with the prefix ox or OX. The constant 0x40 represents the decimal value 64.

45. C++ provides several ways to write a floating–point constant . The simplest way is to use standard decimal notation : 3.1416,2.53,0.3512. Floating –point constant 2.3E5 represents the value 2.3X105 or 230.000.

46. A C++ name consists of a sequence of letters (uppercase and lowercase),digits and underscores. A valid name cannot begin with a digit character.

47. C++ names are case-sensitive.

48. It is very important to pick meaningful and descriptive names for the objects in a program. Descriptive names help other programmers understand what your program is doing.

49. An object must be defined before it can be used ,Smart programmers give an object an initial value when it is defined.

50. Integer division always produces a truncated result. The expression 5/2 produces the result 2 and not 2.5.

51. The usual unary conversions specify that operands of type char or short are converted to type int before proceeding with the operation.

52. For an arithmetic operation involving two integral operands, the usual binary conversions specify that when the operands have different types, the one that is type int is converted to long and a lon