changeset 215 | 06cc38192865 |
parent 211 | e6e160c7ea33 |
child 546 | 3d1f65e43065 |
--- a/progs/C2.c Mon Oct 06 21:29:13 2014 +0100 +++ b/progs/C2.c Mon Oct 06 22:48:09 2014 +0100 @@ -5,10 +5,12 @@ // Since gets() is insecure and produces lots // of warnings, thereofre I use my own input // function instead. +int i; +char ch; + void get_line(char *dst) { char buffer[8]; - int i = 0; - char ch; + i = 0; while ((ch = getchar()) != '\n') { buffer[i++] = ch; }