I am having a difficulty trying to initialize an array of strings. I am working with one class that has different methods: one is intended to charge an array, other is intended to eliminate elements of an array and so on... I need to use the same array in every method inside the class.
The thing is that I need to make a simulation of the array(queue) and show its elements as they are added to or deleted from the queue and I am having problems trying to initialize the array to show nothing instead of random characters.
Here's the code of what I am trying to do...
class Queue
{
public:
char array[3][6]; //array of 3 positions holding up to 6 characters each
int front, rear, max;
Queue()
{
front=0;
rear=0;
max=3;
array={"","",""}; //trying to initialize to blank spaces, here's the issue!
}
void add_element()
{ }
void delete_element()
{ }
void print_on_screen()
{ }
};
main()
{ }
I have made it work by using a one dimension char array, entering a single number for each of the 3 positions but actually need it to work with more than a char.