Project-Scylla/KNR C/ex1-17/store.c

26 lines
331 B
C
Raw Normal View History

#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();
}