We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
I'm using C language. But I don't know how to input a string of unknown length. For example say user input a string, "Have a good day!", how should the programm save enough space for the string. What if the input string length exceeds the declared size of the character array in the code.
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Day 0: Hello, World.
You are viewing a single comment's thread. Return to all comments →
I'm using C language. But I don't know how to input a string of unknown length. For example say user input a string, "Have a good day!", how should the programm save enough space for the string. What if the input string length exceeds the declared size of the character array in the code.