can read user input into strings
This commit is contained in:
parent
aba255affa
commit
86cae67ee8
2 changed files with 10 additions and 4 deletions
BIN
puzzle1
BIN
puzzle1
Binary file not shown.
12
puzzle1.c
12
puzzle1.c
|
|
@ -11,9 +11,15 @@ char stringTwo[stringSize];
|
|||
int readIntoList(char* stringList){
|
||||
int index = 0;
|
||||
|
||||
while (getchar()=='\n'){
|
||||
//eat up new lines in buffer
|
||||
}
|
||||
while(1){
|
||||
char next = getchar();
|
||||
if (next != '\n'){
|
||||
stringList[index] = next;
|
||||
index++;
|
||||
}else{
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
while (1) {
|
||||
readChar = getchar();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue