Networking, Programming and Graphics Tutorials

Arrays within a class [1/1]

Type:
Arrays within a class
Level: Intermediate Networking, Programming and Graphics Tutorials Networking, Programming and Graphics Tutorials 
Arrays within a class
Date: 2008-Jun-27
Arrays within a class
Visited: 924 times
Arrays within a class
Rating: Arrays within a class
Arrays within a class
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:                    
Networking, Programming and Graphics Tutorials - Arrays within a class [1/1] - Networking, Programming and Graphics Tutorials

Need a specific tutorial? Do not hesitate and submit a request!
Related Tags: 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  c++ arrays inside a class  с++ arrays objects class  defining arrays in class, C++