answersLogoWhite

0


Best Answer

The major components of a class are its members (data and methods) and its interface to those members. All classes have four members by default: the default constructor, the copy constructor, the destructor, and the assignment operator. However, if you declare any constructor (including a copy constructor) you lose the default constructor unless you declare your own. The class interface is defined by the public, protected and private sections of the class declaration. The interface may also be extended via friend classes and friend functions. Public and protected interfaces can also be inherited from existing base classes and/or abstract base classes to create derived classes, which may modify the base class interfaces without altering the base class itself. Private members can never be inherited, however.

The interface can be divided into several key components: construction, destruction, operations, attributes, accessors and mutators. Constructors handle the complete initialisation of the class and every constructor must ensure that a valid object exists whenever an object of the class is instantiated. The destructor is purely responsible for cleaning up any dynamic memory allocated on the heap and owned by the class (memory allocated on the stack is always released automatically). Operations include the assignment operator and any other operator overloads that modify the class in some way, such as the prefix increment operator. Attributes include type-casts and boolean operators such as the equality and greater-than operators, plus any member methods that return information about the class. Accessors return specific member values from the class (getters) while mutators modify those same members (setters).

User Avatar

Wiki User

11y ago
This answer is:
User Avatar
More answers
User Avatar

Wiki User

11y ago

The basic structure of a C++ program consists of primitive variables and constants, classes to encapsulate data and to operate upon that data, and external functions to manipulate the variables and objects instantiated from those classes. The minimum requirement of any C++ program is the same as for C: a main function.

This answer is:
User Avatar

User Avatar

Wiki User

10y ago

The simple answer is C, classes and objects. The components of C are data types and functions. A class combines data with the functions that operate upon that data, while an object is an instance of a class.

This answer is:
User Avatar

User Avatar

Wiki User

12y ago

The basic components are the primitive data types (int, char, float, etc) and the built-in functions that use those primitives. Both form the building blocks for user-defined data types and user-defined functions.

This answer is:
User Avatar

User Avatar

Wiki User

6y ago

The major components in C are functions and data structures. Each source file (including its headers) is a "translation unit". The C compiler can only translate one translation unit at a time, thus each unit must be entirely self-contained. Once all units are translated into object files, the linker uses the information provided by the compiler to link the object code to produce an executable.

This answer is:
User Avatar

User Avatar

Wiki User

10y ago

The main components of C++ are keywords, the intrinsic types (integrals and floating point types), enums, functions and classes such as the standard template library (STL).

This answer is:
User Avatar

User Avatar

Wiki User

7y ago

Template-metaprogramming (generic programming), object-oriented programming and procedural programming are the principal features.

This answer is:
User Avatar

User Avatar

Wiki User

11y ago

Editor, compiler and linker.

This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: What is the major components of c programming?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

What is long components in the C programming language?

A 32 bit integer.


Major advantage in cpp compared to c?

The major advantage of C++ over C is the Object Oriented Programming compatibility in C++.


What are the two major types of programming languages in c plus plus?

Object oriented programming and structured programming.


What are the three c plus plus programming language components?

The editor, compiler and linker.


Is the Acer Notebook 15 Suitable for programming?

Depending on what language you are programming it may or not run. However most of the major languages (C, VB, C++, C#) you should be able to run it.


What are major components of a c program?

mujhe kya pta


What are the major programming languages commonly used by organisations in Australia to build software applications?

C++,COBOL,Ruby,C*,JAVA


What is c and c in computer programming?

C and C++ are both high-level programming languages.


Create a spiral in C programming?

create spiral in c programming?


How did C come about?

Programming, its first major application was UNIX.


What has the author Robert Lafore written?

Robert Lafore has written: 'Object-oriented programming in Microsoft C++' -- subject(s): Object-oriented programming (Computer science), C++ (Computer program language), C. 'Microsoft C. Programming for the I.B.M.Personal Computer' 'Object-oriented programming in C++' 'Windows Programming Made Ridiculously Easy Book' 'The Waite Group's C Programming Using Turbo C++ (The Waite Group)' 'Microsoft C programming for the IBM' 'The Waite Group's Microsoft C programming for the PC' -- subject(s): C (Computer program language), IBM microcomputers, Microsoft C (Computer program), Microsoft C., Programming


When was C - programming language - created?

C - programming language - was created in 1972.