I'm doing an exercise asking me to read an input of characters and to output the same characters in uppercase with dynamic arrays. My first code was this
but I think it's a bad algorithm because it first reads the string to calculate the dimension of the array to create and then gives the right values to the array. Is there a method to use just the array saving time and calculation?
I didn't get the "A[i] = word[i] - 32;" part. Anyway the problem persist because you read characters through a string while I want to read data directly using the array