Arrays within a class [1/1]

Type:
Level: Intermediate   
Date: 2008-Jun-27
Visited: 990 times
Rating:
Author: Alex Plumpton

Means to Learn
Arrays can be used as member variable in a class. The example shown in the figure, illustrates a valid class definition. The array variable name[len] is declared as a member of class emp. In the class definition, the member function setvalue() sets the values of elements of emp name[] and display() function displays the value.

Arrays within a class


Interpret the code :

Const int len=20; // provides value for array size

int name[len]; // Men' is integer type array

Means to Learn

Const int len=20; 

Class emp

{
    int name[len]; 
    public:
    void setvalue{void); 
    void display(void);
}

;
Rate this tutorial:                    
- Arrays within a class [1/1] -

Need a specific tutorial? Do not hesitate and submit a request!
Related Tags: Arrays within a class in c++  php arrays in class  c++ class arrays  arrays within a class  c++ arrays class  c++ arrays class  arrays within a class-c++  arrays within a class-c++  c++ class templates arrays  c++ arrays of class objects