summaryrefslogtreecommitdiff
path: root/hw3/problem1.c
diff options
context:
space:
mode:
authorAlexander Pickering <alex@cogarr.net>2020-01-01 22:37:37 -0500
committerAlexander Pickering <alex@cogarr.net>2020-01-01 22:37:37 -0500
commit9fae5d516012e2c0802105e67c79e2587a22b9dc (patch)
tree1c782ad2cd08bd1ecc4f0b42bd042778b4f34c2e /hw3/problem1.c
downloadinfsci2620-9fae5d516012e2c0802105e67c79e2587a22b9dc.tar.gz
infsci2620-9fae5d516012e2c0802105e67c79e2587a22b9dc.tar.bz2
infsci2620-9fae5d516012e2c0802105e67c79e2587a22b9dc.zip
Inital commitHEADmaster
Diffstat (limited to 'hw3/problem1.c')
-rw-r--r--hw3/problem1.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/hw3/problem1.c b/hw3/problem1.c
new file mode 100644
index 0000000..784b570
--- /dev/null
+++ b/hw3/problem1.c
@@ -0,0 +1,17 @@
+#include <stdio.h>
+
+void getString(char *in, int buffer){
+ char *c = in;
+ for(; c < in + buffer; c++){
+ *c = getchar();
+ if(*c == EOF)
+ break;
+ }
+ *c = '\0';
+}
+
+int main(){
+ char test[256];
+ getString(test,100);
+ printf("Got string: %s\n", test);
+}