/* CSE 303, Spring 2009, Marty Stepp This not-very-useful program plays with strings. */ #include #include int main(void) { int i; char str[12] = {'h', 'e', 'l', 'l', 'o', ' ', 'w', 'o', 'r', 'l', 'd', '!'}; char buffer[80]; char test[] = "Daniel Otero"; printf("%d", sizeof(test)); // int nums[10] = {1, 2, 7, 9}; scanf("%s", buffer); printf("You typed %s\n", buffer); for (i = 0; i < 24; i++) { printf("str[%d] is %c (%d)\n", i, str[i], str[i]); } str[4] = 0; printf("str is %s\n", str); str = "booyah"; printf("str is %s\n", str); return 0; }