Stl string tokenizer 2

we can also use normal array also for output array to return

Hello @mikki18,

You can only return a dynamically defined array.
To understand it better, i would suggest you to re-watch the videos related to 2D array and dynamic allocation of your course.

Hope, this would help.

i understood we can’t return a local array which is created in function because it will be destroyed.am i correct ?? is that only the logic?

Yes @mikki18,

You have stated it correct.
When the stack frame, assignened to the function definition in response to a function call, is deleted from the stack, the local variable/array declared inside it also destroys.

Give a like if you are satisfied.

1 Like