Welcome to WebmasterServe!

FREE TO JOIN! Join us now to engage in informative and friendly discussions about Webmastering, SEO, SEM, Internet Marketing, Programming, Graphic Design, Online Jobs and more. What are you waiting for? Ready to join our friendly community? It takes just one minute to register.

Dismiss Notice

Join WebmasterServe Forums 
Join the discussion! Have a better idea or an opinion? It takes just one minute to register Click Here to Join

My 2 Cents What Is Class In C++?

Discussion in 'General Programming Discussions' started by steve taylor, Mar 8, 2016.

  1. steve taylor

    Yellow Belt

    Joined:
    Feb 12, 2016
    Messages:
    769
    Ratings:
    +25 / -0
    We can say that class in the C++ is the next version of structure in C.
    Class contain the objects and set of those operation that can be performed on that objects.

    Syntax of the class :-

    Class class_name
    {
    Data member;
    Functions;
    }


    Example:-

    Class student
    {
    Public:
    Char name;
    Int marks;
    Int no _of _subjects;
    }
     
  2. Pooja Sharma

    Yellow Belt

    Joined:
    Feb 5, 2016
    Messages:
    373
    Ratings:
    +20 / -0
    C++ is an object oriented programming language. It is declared the same way as struct in C++.They include functions to access the data and possess the ability to inherit from other classes. It is a mechanism that allows you to combine data and the function in a single unit.
     
  3. krishatg

    Yellow Belt

    Joined:
    Jan 16, 2016
    Messages:
    240
    Ratings:
    +14 / -0
    In object oriented programming classes are template of methods & variables enclosed within a particular kind of object . Thus, an object is basically a instance of a class.

    SYNTAX:

    Class classname
    {
    Access specifier:
    Variables;
    Methods;
    };
     
  4. Prasoon Arora

    Yellow Belt

    Joined:
    Feb 1, 2016
    Messages:
    472
    Ratings:
    +24 / -0
    In C++, class is defined as a collection of data and functions belonging to it. The access of users on class is further categorized as private, public or protected. By default access to members belonging to class is set as private and can be change accordingly.
     
  5. RADHESHYAM GUPTA

    Yellow Belt

    Joined:
    Feb 13, 2016
    Messages:
    362
    Ratings:
    +20 / -0
    C++ is an data structure, in c++ class is a keyword class followed with keyword name and his body. you can also use private and protected class in c++.
    C++ class example :-
    class Box
    {
    public:
    Single length; // Length of a box
    Single breadth; // Breadth of a box
    Single height; // Height of a box
    };
     
  6. VIVEK KUMAR

    Yellow Belt

    Joined:
    Mar 8, 2016
    Messages:
    300
    Ratings:
    +2 / -0
    Most of the programming language provide inbuilt data type as well as user define data type. As C programming language provide user define data type like union and structure. In the C++ class is the user defined data type. Class bind the data and member function together.
     

Share This Page