List_of_strings into character array ! !11111111111111111111111

sir wrote the program i completely understand just one doubt i have in this when we include cin.get and n=5 and give 5 strings it will print all 5 strings but without cin.get we give n=5 it will able to accept 4 strings my guess is one it take as white space pls correct me in this

yes you are right
it takes all 5 strings but the first string it takes is a whitspace

so to remove that whitspace we have to use cin.get()

sir i want to know little brief for this doubt i mean who is responsible for creating white space cin as sir said at 00.27 that we use cin,get to consume the extra enter followed after n

your input is responsible
when you give input then you press enter to give another input
that enter is whitespace and it should consume
otherwise cin.getline() will consider it as first string

strings read operation start inside the for loop i guess the enter of cin>>n will consume by cin.get()

yes, you understood correct

if you don’t consume it outside loop
then it will be consider by cin.getline()

is your doubt resolved?

if not you can watch this cin.get() v/s cin.getline()
nicely explain the concept

now i am marking your doubt as resolved
plz give your feedback from link given below