summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorLevi Bostian <levi.bostian@gmail.com>2013-09-20 22:37:40 -0500
committerLevi Bostian <levi.bostian@gmail.com>2013-09-20 22:37:40 -0500
commit981cc871a4d4e5473e580dee8574a119ac8a9723 (patch)
tree14e0b20ddbd7f1c15c67b3ec630bcf529a6cb633
parent67cd987efa06141e5dac74f07fa8f561265c835a (diff)
Edit getchar() notes.
-rw-r--r--c.html.markdown7
1 files changed, 3 insertions, 4 deletions
diff --git a/c.html.markdown b/c.html.markdown
index d075ea0e..ee35cdd2 100644
--- a/c.html.markdown
+++ b/c.html.markdown
@@ -453,15 +453,14 @@ void str_reverse(char *str_in)
/////////////////////////////////////
// Built in functions:
/////////////////////////////////////
-// from stdio.h:
-// getchar()
-int c = getchar(); //reads character from input.
+// from: #include <stdio.h>
+// ** getchar() **
+// int c = getchar(); //reads character from input.
// If input = hi, 'h' is returned then next call, 'i' returned.
while ((c = getchar()) != EOF) { // EOF constant "end of file".
// Linux: CTRL+D, Windows: CTRL+X
// must have () around getchar() as != is run before =.
putchar(c); //prints character (without newline at end)
- char c = getchar();
}
//if referring to external variables outside function, must use extern keyword.