2
Contributors
5
Replies
6
Views
6 Years
Discussion Span
Last Post by Eddiebauer
0

post an example of what you are talking about. It might mean the function returns a 2d array of some sort. It could also mean that its a pointer to a function. Never know until you tell us more.

Edited by Ancient Dragon: n/a

0

You are contributing the following post:
I must write a program that includes char ** read (int n) function . The program reads every char pressed on the keyboard and put it in the dynamic array. Also if I press Enter it should be noticed by program because I should give the number n with cin and it is the value of max times I can press enter and maximum rows of characters (completed by ENTER), and then leads all the chars to the console in reverse order. I wrote some code but I don't know how to finish it because it should give all the chars in reverse order.

0

As I understand it n is the number of rows you have to type, the number of characters on each row can be any random value -- the end of a row is when you press the <Enter> key.

char **read(int n)
{
   char** array = new char*[n];

   ...
   return array;
}

To display the chararacters backwards just display them in reverse order -- by that I mean to start at the end of a line and display the charcters one at a time from the back to the front.

Edited by Ancient Dragon: n/a

0

Thank you, that you helped me so much. You have understood me properly and your answer is value for me and I solved my problem.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.