Hi! Good day. Uhh..I'm still learning how to use C. I'd like to ask for help about storing arrays.. here's how it goes.. When I input a string/char I'd like to store it an array. E.G. "Hi" output will be H i. God. I'm having a hard time explaining this.. I give another example...I input Hello World the output will be.. H e l l o W o r l d any help?
Follow these steps : - Declare a character array of (say) 50 bytes - use 'getchar()' or 'gets' to accept input. - Store the input in array. - Print the array (as required).
Something like this maybe? Code: char *str="Hello world"; for (int i=0; str[i]; i++) { putchar(str[i]); putchar(' '); }