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.

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

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.