summaryrefslogtreecommitdiff
path: root/hw3/problem1.c
blob: 784b5704e6cd89370776f27042cd2f9f9733ad52 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
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);
}