0
How would i enter an unlimited input from the user into a dynamic memory malloc array? Needed in c language.
I need this without entering the amount that i want to input. How would i do this? Can you show me an example pls?
2 Antworten
+ 4
Use while loop and just pass bool value it will ask for input again an again but u need to set any base condition for exit otherwise your program can be crash
0
After the initial call to malloc you can use realloc to increase the size as needed.