I have created a program that takes user inputs and places the inputs of strings into a vector. My issue is I want to display the size of the strings that have been input into the vector. I under stand that using:
sizeof(vec[i])
in my for loop to display my input size only displays the size in bytes of the vector.
However when I use:
str.size(vec[i])
I get an error telling me that str was not declared in the scope when I have the "string" library included. Am I going about printing the sizes wrong or is there something I do not know yet. As I am still a beginner, please feel free to point out any other issues and guide me to a solution. Thanks! Source code below:
Yes! It worked! Thank you so much. Oddly enough I used that same syntax but received an error. I must have tried to put something in the parentheses after size or just used size(vec[i]) which also gives me errors.