What is the new char used in new char[strlen(input)+1] used in the program in this video?

What is the new char used in new char[strlen(input)+1] used in the program in this video?

havent seen this before?

hi @Nitin-Bhattacharyya-2319140631658033 new char[size] this syntax is used to declare an array dynamically. In a static array, you must tell the size of array at compilation time. If you want to declare an array at runtime then dynamic memory allocation has to be used. It will be covered in the course in detail. Feel free to reach out in case of any other queries.

Thanks for the explanation,I will mark it as resolved.

1 Like

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.