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
Post a Comment