Segregation of Data and Functions in C++ and C

ankitdixit

New Member
Joined
Feb 2, 2022
Messages
3
Hello Everyone, I am learning C++ programming and working on a project. I want to know which programing language separates the function and data between C and C++ programming. According to this source, In The case of C++, the data and functions stay encapsulated in an object’s form but not an idea about C Programming. Can anyone suggest me? which one is best?
 

Excel Facts

When did Power Query debut in Excel?
Although it was an add-in in Excel 2010 & Excel 2013, Power Query became a part of Excel in 2016, in Data, Get & Transform Data.
No language is "best". A language can be better for a particular application using a particular approach.

It is not really clear what your question is.

C++ is basically a superset of C which supports object-oriented programming (OOP). The object-oriented paradigm defines a class as having a state (data) and methods (functions). Objects are instantiated from the class, and other entities can interact with these objects. The advantage to this model is that the data and functionality are bound together and the data can be hidden from any external entities. The external entities interact strictly through the exposed methods, providing data encapsulation and abstraction. In this way objects have a kind of a contract with one another based on the exposed methods.

C is a low-level procedural language. In C, you have functions, and can build a program structure as a hierarchy of functions. The programming approach and structure is completely left to the programmer. It is possible to contrive a C structure where you encapsulate data and functions that works like OOP, but that's not the way C programmers typically to do it. The C language does not separate functions and data, but how and whether they are separated is a result of how the programmer structures the code.

Given that information, can you rephrase your question to be a little more specific?
 
Upvote 0

Forum statistics

Threads
1,224,817
Messages
6,181,147
Members
453,021
Latest member
Justyna P

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top