1

Hi all. Just a simple question but I SERIOUSLY need some help from you guys for my programming assignment.

The assignment given was water jug problem.

Now my question is, does C allow for the creation of dynamic array during a recursion?
Suppose I have another function, which returns a value (well in my case the function returns a character), and I'm gonna store the character into a dynamic array(which in the current function). This means that the dynamic array is constantly "enlarged" as long as another function returns a value to the current function where the dynamic array is located. If the other function stops returning a value, the whole process stops.

Thanks in advance.

2
Contributors
1
Reply
2
Views
7 Years
Discussion Span
Last Post by gerard4143
0

Hi all. Just a simple question but I SERIOUSLY need some help from you guys for my programming assignment.

The assignment given was water jug problem.

Now my question is, does C allow for the creation of dynamic array during a recursion?
Suppose I have another function, which returns a value (well in my case the function returns a character), and I'm gonna store the character into a dynamic array(which in the current function). This means that the dynamic array is constantly "enlarged" as long as another function returns a value to the current function where the dynamic array is located. If the other function stops returning a value, the whole process stops.

Thanks in advance.

Dynamic array yes..Look up VLA - variable length arrays

Edited by gerard4143: n/a

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.