WIP overbuilt solution to exercise 1-17.

This commit is contained in:
Reina Harrington-Affine 2025-09-17 20:54:19 +00:00
parent 2084b2ae84
commit 848898ff11
2 changed files with 101 additions and 0 deletions

25
KNR C/ex1-17/store.c Normal file
View file

@ -0,0 +1,25 @@
#include <stdio.h>
char buffer[32000] = {0};
void store(char to[]){
int toCrsr = 0;
for(int i = getchar();i != EOF; ++toCrsr){
to[toCrsr] = i;
i = getchar();
}
}
void test(){
int pos = 0;
for(char b = buffer[pos]; b != 0; ++pos){
putchar(buffer[pos]);
b = buffer[pos];
}
}
int main(){
store(buffer);
test();
}