can read user input into strings

This commit is contained in:
Seth Samuel 2024-12-01 19:36:13 +13:00
parent aba255affa
commit 86cae67ee8
2 changed files with 10 additions and 4 deletions

BIN
puzzle1

Binary file not shown.

View file

@ -11,8 +11,14 @@ 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) {