I understand what initialize means but in this program I don't understand the purpose of it. Can anyone make any sense of what it dose based on the assignment I was asked below. I have all the rest of the program built accept this member function.
1. Create a class - ASCIICode - that allocates an array of characters of a given size using the new operator and initializes each element in the character array with symbol that has the ASCII code as its subscript. For example, the 98th element (with 97 as its subscript) of the array should contain 'a'. The class should have at least the following data members and member functions:
* a data member -size - that represents the size of the array.
* a static data member - count - that is used as a 'global shared variable' to count how many ASCIICode objects are created in a program.
* a constructor that accepts an integer for the size of the character array.
* a constructor that accepts no argument. (In this case, default the character array with size 255.)
a member function - initialize - that performs the initialization
* an overloaded constant member function - print - that prints an element or all elements in the character array.
* a member function - showSize - that displays the size of the array.
* a member function - showCount - that displays the count.
* a destructor that destroys the dynamically allocated character array.
2. Create a proxy class - ASCIICodeCover - to hide private data members of ASCIICode.
3. Create a driver program that tests above classes.
This post has been edited by lockdown: 01 May 2008 - 12:27 PM