0

I am having problems getting my procedure to read characters recursively to terminate. Can somebody help me here, I am not suppose to use arrays or lists. I have the following procedure:

void recursive()
{
	char c;
	cin>>c;
	cout<<c;
	recursive();
	return;
}

I also need to print the characters backwards.

2
Contributors
7
Replies
8
Views
8 Years
Discussion Span
Last Post by AlSal
0

I need it to terminate when the last character is found. It reads all the characters but simply does not find the end.

0

And what thread should I use. I thought compilers fit into computer science

0

So the question is: How to detect when last character found? You surely know how to do that? Well then, finding the recursive function that outputs them in reverse order is a simple matter of mentally stimulating exploration! Good luck!

0

I know how to do the inverse order. What I am having problems is with the base case for the recursion.

This question has already been answered. 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.