Creating an array of strings through user input in c? -


i'm new c clarification helpful! i'm trying use scanner ask program series of words store..what have far is,

     char[]listofwords[9999]; //creates large array of characters      scanf("%s", listofwords); //stores inputs listofwords 

with this, can access first word easily, comes matter of accessing second, , third words..any suggestion? example, how input was

 hello how guys 

i can access "hello" no problem, how call "how" , "are"

scanf() accepts input single word.(not after space.)

to enter multiple words, can use gets(string) or scanf("%[^\n]", string).


Comments

Popular posts from this blog

java - Date formats difference between yyyy-MM-dd'T'HH:mm:ss and yyyy-MM-dd'T'HH:mm:ssXXX -

c# - Get rid of xmlns attribute when adding node to existing xml -