summaryrefslogtreecommitdiffstats
path: root/1/19.c
diff options
context:
space:
mode:
authorSadeep Madurange <smadurange@users.noreply.github.com>2021-11-20 22:30:13 +0800
committerSadeep Madurange <smadurange@users.noreply.github.com>2021-11-20 22:30:13 +0800
commit6f4c5b043451ebb574c35e0d7a2a77c000cf1a8e (patch)
treeb4ff6c9855156219523eac89835eaffbf805eb77 /1/19.c
parent6ba86a94de8dd525ac1bf9512aac9196c566033a (diff)
downloadk&r-exercises-6f4c5b043451ebb574c35e0d7a2a77c000cf1a8e.tar.gz
1.19
Diffstat (limited to '1/19.c')
-rw-r--r--1/19.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/1/19.c b/1/19.c
index 5ddca85..ef586fa 100644
--- a/1/19.c
+++ b/1/19.c
@@ -2,7 +2,7 @@
#define MAXLEN 1000
-int cgetline(char s[], int max);
+int mygetline(char s[], int max);
void reverse(char s[], int size);
/* reverses input string */
@@ -10,7 +10,7 @@ int main(int argc, char *argv[]) {
int size;
char s[MAXLEN];
- while ((size = cgetline(s, MAXLEN)) > 0) {
+ while ((size = mygetline(s, MAXLEN)) > 0) {
reverse(s, size);
printf("%s\n", s);
}
@@ -23,7 +23,7 @@ int main(int argc, char *argv[]) {
return 0;
}
-int cgetline(char s[], int max) {
+int mygetline(char s[], int max) {
int c, i;
for (i = 0; i < max - 1 && (c = getchar()) != EOF && c != '\n'; i++)