I will give an example of the difference between c and c++

/* C Code */
struct stack
{

An example
/* C code*/

struct stack
{
int elt[100];
int top ;
}s;

void push(int x)
{
/* code to push*/
}

int pop()
{
/* code to pop*/
}

void main()
{
int i;
s.push(100);
i = s.pop();
}

// c++ code
class stack
{
private :
int elt[100],top;
public:
void push();
int pop();
} s;
main()
{
int i;
s.push(100);
i = s.pop();
}
U can clearly see that in C++ , not only the properties(say variables), but also the methods(functions) to act on those variables are part of the datatype.