Code related problem

in line 6 if i write string *inp, compiler throw compile error
but if i write string inp , program execute why?

hello @officialharshit1996 there is a big difference between both the declarations .

@officialharshit1996 if you want to do in that way then you have to declare the array of strings as dynamically and then you have to do every thing on array .
and if you are doing like this then you are unnecessarily making your program complicated and when it only depends everything on your logic .
if you still have any doubt you can ask here .
but if you feel that your doubt is cleared you can now mark this doubt as resolved .
Happy Learning !!