summaryrefslogtreecommitdiffstats
path: root/3
diff options
context:
space:
mode:
authorSadeep Madurange <smadurange@users.noreply.github.com>2021-12-03 19:50:22 +0800
committerSadeep Madurange <smadurange@users.noreply.github.com>2021-12-03 19:50:22 +0800
commit091198e19883a563fcd45c70d66692efc6d3f4d5 (patch)
treee26d0d5cf4ab40a2d72b09d7270cab4df8161ebd /3
parentb15749294b1dac15bf43989e5464fc4ed594673c (diff)
downloadk&r-exercises-091198e19883a563fcd45c70d66692efc6d3f4d5.tar.gz
3.4
Diffstat (limited to '3')
-rw-r--r--3/4.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/3/4.c b/3/4.c
index 1ec8d15..4749fde 100644
--- a/3/4.c
+++ b/3/4.c
@@ -5,6 +5,10 @@
#define MAXLEN 50
+// Explanation of the error:
+// In itoa, for largest negative number, n = -n overflows
+// resulting in n = INT_MIN (wraps around) causing a god awful mess.
+
void itoa(int n, char s[]);
void reverse(char s[]);