break; break; num_others++; num_vowels++; // a is 5, b is 2, c is 6, d is 4 case 'a': case 'e': case 'i': case 'o': case 'u': default: i, values[i]); int a = 5; // hides first a int c = 6; // ditto for c } // Can use a, b, c, d here // a is ___, b is ___, c is ___, d is ___ b[bi++] = a[ai--]; b[bi++] = a[ai--]; int c = 3, d = 4; num_vowels, num_others); printf("Of course not!\n"); printf("Of course not!\n\n"); printf("Surely!\n"); printf("Surely!\n\n"); printf("values[%d] = %d\n", switch (c) { vals[i] = i*i; { } } *p = i * i; //double zz = sum(cube); // error: "incompatible type" a_print(rvals, N); a_print(vals, N); ask_politician(); ask_politician(); ask_politician(); ask_politician(); ask_politician(); ask_politician(); ask_politician(); char *manufacturer; char *manufacturer; char ends[2]; // 'M' or 'F' char ends[2]; // 'M' or 'F' char initial[] = "X. "; double length; double length; double x; double x; double x; double x; double x; double y; double y; double y; double y; double y; else else for (i = 0; i < N; i++) for (i = 0; i <= 4; i++) if (yes_no) if (yes_no) initial[0] = middle[0]; int a = 1, b = 2; int ai = size - 1, bi = 0; int ai = size - 1, bi = 0; int c; int conductors; int conductors; int i, vals[N], rvals[N]; int i; int num_vowels = 0, num_others = 0; int values[5]; // An array of 5 ints newPoint.x = p.x + xdelta; newPoint.y = p.y + ydelta; printf("%d vowels, %d others\n", return newPoint; reverse(vals, rvals, N); static int yes_no = 1; static int yes_no = 1; strcat(result, " "); strcat(result, initial); strcat(result, last); strcpy(result, first); struct Point newPoint; struct Point p1, p2; struct Point p1, p2; struct Point p1, p2; struct Point p1, p2; sum += *p; values[0] = 1; values[1] = 2; values[2] = values[0] + values[1]; values[4] = 20; values[values[2]] = 10; while ((c = getchar()) != -1) { while (bi < size) while (bi < size) yes_no = !yes_no; yes_no = !yes_no; { } } } } ; } ; } ; } ; }; }; }; }; }; }; }; double xdelta, double ydelta) goto recycle: ... ... if (...) } *p = to; *p++ = operand[0]; break; break; break; lp = &a[i]; new->next = p->next; p->next = new; strlen(string)); while (...) { } } } (L.p2.x - L.p1.x); (*next_field_addr)->count++; (*next_field_addr)->count++; (*next_field_addr)->total += nbytes; *evens += 1; *next = 0; *next = 0; *next = 0; *next = 0; *odds += 1; *p = '\0'; // end command with a zero byte append(buf0, buf1); append(buf0, line); append(buf1, buf0); append(buf1, line); break; break; break; break; buf = newbuf; buf = newbuf; char *newbuf = malloc(len); char *newbuf = malloc(len); char *p = string; char *p; char from = operand[0]; char to = operand[2]; continue; continue; end = buf + (len - 1); // &buf[len-1]; end = buf + (len - 1); // &buf[len-1]; for ( ... ) { for (p = strchr(string, from); p; p = strchr(p + 1, from)) free(buf); free(buf); i, &a[i]); i, *p, p); i, rects[i].width, rects[i].height); if (!lp || a[i] > *lp) if (strcmp(p->next->line, line) > 0) { len += chunk_size; len += chunk_size; longest = &strings[i]; longest = &strings[i]; longest = p2p; longest = p2p; next = newbuf + (next - buf); next = newbuf + (next - buf); num_lines, num_chars); num_mallocs++; operand = p + 1; // operand is after 1st space p->next = new; p->tag, p->count, p->total); printf("%d (at %u)\n", i*400, a); printf("%d\n", c); printf("Largest negative in first %d is %d, at %u\n", printf("No negatives in first %d elements\n", i); printf("\t'%s' (%d chars)\n", string, puts(*next--); return buf; return buf; return i; return p - p0; return p; return pos; return pos; return pos; uh-oh return; return; strcat(string, operand); strcpy(newbuf, buf); strcpy(newbuf, buf); strcpy(string, operand); // start string afresh string[0] = '\0'; struct malloc_block *mb = malloc_list[i]; tally(mb->tag, mb->nbytes, &tally_head); total_bytes += malloc_list[i]->nbytes; while (*p) } } } } } } } } } } } } } "sizeof(long double) = %d\n", "sizeof(long double) = %d\n", sizeof(float), sizeof(double), sizeof(long double)); sizeof(float), sizeof(double), sizeof(long double)); (*p2p)++; (struct malloc_block*)(block - mb_size); *end-- = t; *end-- = t; *front++ = *end; *front++ = *end; *next++ = c; *next++ = c; *next++ = line; *next_ent++ = lp; *p++ = c; *p++ = c; *p++ = c; *p++ = c; *p++ = c; *p++ = c; *p++ = m++; *p2p = new; /*printf("command: '%s', operand: '%s'\n", //printf(">%s< (%d)\n", p, strlen(p)); //printf(">%s< (%d)\n", p, strlen(p)); //printf("c = %d\n", c); ; ; ; ; ; ; ; ; ; ; a[i] = 0; append(buf, "<\n"); append(buf, ">"); append(buf, line); append(line, "\n"); assert(next < &lines[MAX_LINES]); assert(p != 0); break; c = rev_line(); c++; case 1: printf("a = %d\n", p->u.a); case 2: printf("s = '%s'\n", p->u.s); char *lp = our_malloc(strlen(line)+1, 1002); char *p = malloc(1000000); char *p = strchr(line, ' '); // find 1st blank char *r = concat(a,b); char digits[] = "0123456789"; char digits[] = "0123456789"; char s1[] = "x"; char s2[] = "a loooooong string here"; char s[10]; char t = *front; char t = *front; debug = 1; debug = 1; double x; else else else if (strcmp(line, "add") == 0) else if (strcmp(line, "change") == 0) { else if (strcmp(line, "clear") == 0) else if (strcmp(line, "overwrite") == 0) { else if (strcmp(line, "print") == 0) else if (strlen(*p2p) > strlen(*longest)) else if (strlen(strings[i]) > strlen(*longest)) else { f("testing"); f(); f(s1); f(s2); fill(buf, c, c - 'a' + 1); fill(buf, c, c - 'a' + 1); for (p = &root; p->next; p = p->next) free(buf); free(buf); free(p); free(p); free(r); gchar(); goto done; i++; i++; i++; i, rects[i].width, rects[i].height); if (!p) if ((*next_field_addr)->tag == tag) { if ((*next_field_addr)->value == i) { if (*p == c) if (*p == c) if (++i % 1000 == 0) if (a[i] % 2 == 0) if (a[i] < 0) if (c == '\n') if (c == '\n') if (c == '\n') if (c == '\n') if (c == '\n') if (c == '\n') if (c == '\n') { if (c == '\n') { if (c == -1) if (c == -1) break; if (isprint(c)) if (longest == 0) if (longest == 0) if (malloc_list[i] == 0) if (malloc_list[i]) { if (malloc_list[i]) { if (next == end) { if (next == end) { if (p != 0) { if (p->next == 0) if (s[pos] == c) if (s[pos] == c) if (s[pos] == c) if (strcmp(line, "set") == 0) if (which == 0) { insert(&(*p2p)->left, value); insert(&(*p2p)->right, value); insert(&root, vals[i]); int *a = malloc(100 * sizeof(int)); int *p = largest_negative(a, i); int a = 10; int a; int c; int len = sizeof(s); int n; int result; int result; lbrack, quote, newline, bslash, rbrack); len++; len++; len++; len++; let_a, dollar, 'b'); line, operand);*/ my_heap_ptr += nbytes; nbytes += sizeof(double) - remainder; new->left = new->right = 0; new->line = line; new->next = 0; new->value = value; next--; next_field_addr = &(*next_field_addr)->next; next_field_addr = &(*next_field_addr)->next; next_pool_addr += nbytes; num_chars++; num_lines++; nums[i] = i + 1; nums[i] = i + 1; nums[i] = i + 1; nums[i] = i + 1; nums[i] = i + 1; our_free(*next_ent); our_free(to_free); p = (int)digits; p = p + 1; p = p->next; p++; p++; p++; p++; p[i] = i; pchar(); pdigits(n/10); printf("%2d ", a[i]); printf("%2d ", a[i]); printf("%3d", *p++); printf("%3d", *p++); printf("%d: %d occurrences\n", p->value, p->count); printf("%d\n", getchar()); printf("%d\n", i); printf("%d\n", i); printf("%d\n", n%10); printf("%s (%d chars)\n", a[i], strlen(a[i])); printf("%s (%u)\n", p, p); printf("%s + %s = %s\n", a, b, r); printf("%s\n", buf); printf("%s\n", buf); printf("&a[%d] = %u\n", printf("&result = %u\n", &result); printf("&result = %u\n", &result); printf(">%s<\n", argv[i]); printf("C: %d\n", j); printf("Hello!\n"); printf("Rectangle %d: %d x %d\n", printf("Tag %d: %d allocations (%d total bytes)\n", printf("a = %d, b = %d, c = %d, d = %d\n", a,b);//,c,d); printf("a = %d, b = %d, c = %d, d = %d\n", a,b,c,d); printf("a = %d, b = %d, c = %d, d = %d\n", a,b,c,d); printf("a = %d, b = %d, c = %d, d = %d\n", a,b,c,d); printf("entry not found\n"); printf("entry not found\n"); printf("g() called\n"); printf("g() called\n"); printf("len is %d\n", len); printf("n is non-zero\n"); printf("n is zero\n"); printf("p = %u, *p = %c, len = %d\n", p, *p, len); printf("p = %u\n", p); printf("s is '%s'\n", s); printf("sum is %d\n", sum(n)); pstring(buf0); pstring(buf1); putchar(*p++); putchar(c); putchar(c); putchar(i); putchar(i++["Hello!\n"]); putchar(s[i]); putchar(s[i]); putchar(s[i]); putchar(s[i]); putchar(s[i]); puts(*next_ent); puts(label); puts(label); puts(line); puts(p); puts(p); puts(p->line); rects[i].height = h; rects[i].width = w; result = n * factorial(n - 1); result = n * factorial(n - 1); result[i] = c; return -1; return -1; return -1; return 0; return 0; return 0; return 0; return 0; return 1; return 1; return a; return b; return block_addr; return c; return n + sum(n-1) return r; return result; return result; return; return; reverse(p); reverse(p); s[i] = c; s[i] = c; s[i] = c; s[spos++] = c; s[spos++] = c; s[spos++] = c; scanf("%d", &n); scanf("%s %s", a, b); sizeof(int)); strcpy(lp, line); struct LineNode *new = malloc(sizeof(struct LineNode)); struct a struct b struct c struct node *new = malloc(sizeof(struct node)); struct tally_node *to_free = p; struct { int s1i; } s1; struct { int s2i; } s2; sum += *p++; sum += *p++; sum += *p++; sum += *p--; sum += *p--; sum += a[i]; sum += a[i]; sum += a[i]; sum += a[i]; sum_of_areas += rects[i].width * rects[i].height; tally(num, &head); to++; topos++; topos++; topos++; v = 10; v = 10; void *block_addr = next_pool_addr; void *r = my_heap_ptr; which = !which; while ( ... ) { while (next >= lines) { 't', 'e', 's', 't', 'i', 'n', 'g', '\n', '\0' }; } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } u; } u; rp < &rects[5]; rp++, w += 2, h += 3) { sdf int b = 10000000000; "Cables 'R Us", 4.0, 3, 'F', 'M', "connectem.com" &a[0] = &b[0]; (f(),x) += 2; (f(),x) = (f(),x) + 2; *(a + i) = i; *ap = *bp; *b = 'x'; *bp = t; *larger(&a[0], &a[1]) = *larger(&i, &j); *lhs = value; *lhs = value; *next = 0; *next = 0; *next_field_addr = node; *next_field_addr = node; *p = 'X'; *p = 0; *p = 0; *p = 0; *p = 0; *p = 0; *p = 0; *p = 0; *p = 0; *p2p = p; --*pi++; ...do something appropriate... /*if (p1 == 400);*/ /*iprint(-100.%23);*/ // // ... // ... // ... // ... // ... // ... // ... // ... // Look for unused entry // TODO: should align to dword boundary // Todo: free tally list... // a is ___, b is ___, c is ___, d is ___ // i++ = 0; // "invalid lvalue in assignment" // j = --i++; // "invalid lvalue in decrement" // return n ? n + sum(n-1) : 0; //char *int = calloc(int nelems, int elemsize) //char a = 'a', b='z'; //char b[length(a)+1]; //char digits[] = "0123456789"; //char s[] = string_lit1; //char string_lit1[] = { 't', 'e', 's', 't', '\0', 'a', 'b', 'c', '\0' }; //double z = cube(sum(3)); // error: "too few arguments" //int *p = malloc(100 * sizeof(int)); //int i; //int i;// Ok without it, blows with it //int r = sum(0xffffff,-2); //int r = sum(1,2); //int r = sum(3, 4); //int r = sum(3, 4.0); //int r = sum(3000000004, 43434324, 2342332234, 32432432); //int r = sum(a,b); //printf("i = %s\n", 7); //printf("p = %d\n", p); //printf("r = %d\n", r); //s1.type = 1; //s1.u.a = 10; //strncat(lets, "x\0[]()", 4); //strncpy(lets, "1\0[]()", 4); //struct tally_node *node = our_malloc(sizeof(struct tally_node), 2201); //while ((c = getchar()) != -1) //} 1 - p1 ; 1.5, 3, 'M', 'M', "Joe's Cables", 2.5, 9, 'M', 'F', 3 < 4; A.p1 = Translate(A.p1, 0, 10); X x1 = {10, f1}; X x2 = {20, f2}; a = b; a[-1] = 60; a[0] = 10; a[0] = s1; // &s1[0] a[1] = s2; a[2] = s3; a[3] = 30; a[4] = 0; a[4] = 40; a[5] = 50; a[i] = i; addr(a); addr(a); addr(a[0]); addr(b[0]); addr(a[5]); addr(b[3]); addr(b); addr(v); assert(max_malloc < MAX_MALLOCS); assert(mb = malloc(nbytes + mb_size)); assign(&a[i], i); assign(&a[i], i); assign(i, 1); c = getchar(); c = getchar(); c--; char **lines = our_malloc(NLINES * sizeof(char*), 1001); char **lng = longest(a); char **lng = longest(a); char **longest = 0, **p2p; char **longest = 0, **p2p; char **next = lines; char **next_ent = lines; char **p2p; char *a[3]; char *a[] = { "Give", "me", "more", "pointers", "please!", 0 }; char *a[] = { "Give", "me", "more", "pointers", "please!", 0 }; char *a[] = { "one", "two", "three"}; char *b = "testing"; char *buf = malloc((n+1)*sizeof(char)); // sizeof(char) is always 1 but... char *buf = malloc((n+1)*sizeof(char)); // sizeof(char) is always 1 but... char *buf = malloc(len * sizeof(char)); char *buf = malloc(len * sizeof(char)); char *end = buf + (len - 1); // Leave room for terminator char *end = buf + (len - 1); // Leave room for terminator char *end = front + strlen(front) - 1; char *end = front + strlen(front) - 1; char *line; char *line; char *line; char *lines[MAX_LINES]; char *next = buf; char *next = buf; char *operand; char *p = allocate(100000); char *p = allocate(9); char *p = buf; char *p = buf; char *p = replicate(10, 'x'); char *p = replicate(i, 'A'); char *p = result; char *p = s; char *p = s; char *p = s; char *p = s; char *p = s; char *p = s; // p = &s[0]; char *p = strtok(s, " "); char *p0 = p; char *p1 = *p2p; char *p2 = p; char *p2 = s; char *p; char *p; char *p; char *p; char *result = malloc((len1+strlen(s2)+1)*sizeof(char)); char *s2 = "testing"; char *s3 = s2 + 4; char *s; char *xs = replicate('x', 10); char a[100], b[100]; char a[10]; char a[20] = "testing"; char a[20]; char a[] = "pickles"; char b[20]; char b[] = "testing"; char b[n]; char buf0[100000] = ""; char buf1[100000] = ""; char buf[100000] = ""; char buf[30]; char buf[30]; char c = 'a'; char c = 0; char c = 255; char c1 = 98, c2 = 0x2a, c3 = 0100; char c2 = i; char c; char c; char dollar = '$', let_a = 'a'; char lbrack = '\x5b', rbrack = '\135'; char lets[] = "abcdefghijkl"; char line[100]; char line[100]; char line[100]; char line[100]; char line[500]; char p[] = "abcdefg\0xyz"; char quote = '\'', newline = '\n', bslash = '\\'; char result[100]; char result[n+1] char result[n+1]; char s1[] = ""; char s1[] = "abc"; char s1[] = { 'a', 'b', 'c', 0 }; char s2[] = "abc"; char s2[] = "x"; char s[10]; char s[5]; char s[5]; char s[5]; char s[5]; char s[] = "Hello!"; char s[] = "abc"; char s[] = "just a test"; char s[] = "test\0abc"; char string[500] = ""; char string_literal1[ ] = concat(s, " this"); copy(&b[length(b)], a); copy(a, b); copy(b, &a[1]); copy(b, a); copy(s, "testing"); do x = 1; while (1); dollar = 1; double b = -1e3; double c = 1234e-10; double d1 = 3.0; double d2 = 4.0; double i = 10, j = 20; double q = 1.0 / 0.0; double q = 10.0 / 0; double result; double x = 12.34; double x = sum(3, 4); // converts 3 and 4 to double double x, y = 0.0; double x, y; double x; double y = cube(x); // converts int result to double dp++; else else else else else else else if (value <= (*p2p)->value) else { else { else { f("abc"); f("abc"); f(&a[3]); f(&c[50]); f(&s1); f(&s2); f(&s3); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(1); f(1, 2, 3); f(1.0, 2.0); f(10); f(10, 20); f(100, 200, 300); f(12.34); // a = 1076407828, b = 2061584302 f(1234.0); f(a); f(a); f(a); f(b); f(b); f(c); f(debug); f(values); f1(a); f2(a); fill(buf, 'a', 3); fill(buf, 'a', 3); fill(buf, 'a', 3); // Put "aaa" in buf fill(buf, 'e', 5); fill(buf, 'e', 5); fill(buf, 'e', 5); fill(buf, 'x', 10); fill(buf, 'x', 10); fill(buf, 'x', 10); float a = 123.456; float f = 12.34; for (...) { for (;;) { for (;;) { for (;;) { for (i = 0, w = 3, h = 4; i < 5; i++, w += 2, h += 3) { for (i = 0; i < 100; i++) for (i = 0; i < 20; i++) for (i = 0; i < 3; i++) for (i = 0; i < 5; i++) for (i = 0; i < 5; i++) for (i = 0; i < argc; i++) for (i = 0; i < max_malloc; i++) for (i = 0; i < max_malloc; i++) for (i = 0; i < max_malloc; i++) { for (i = 0; i < n; i++) for (i = 0; i < n; i++) for (i = 0; i < n; i++) for (i = 0; i < n; i++) for (i = 0; i < nelems; i++) for (i = 0; i < nelems; i++) for (i = 0; i < nelems; i++) for (i = 0; i < nelems; i++) for (i = 0; i < size; i++) for (i = 0; i < size; i++) for (i = 0; i < size; i++) for (i = 0; i < size; i++) for (i = 0; i < sizeof(a)/sizeof(a[0]); i++) for (i = 0; i < sizeof(a)/sizeof(a[0]); i++) { for (i = 0; i < sizeof(vals)/sizeof(vals[0]); i++) { for (i = 0; i <= 255; i++) for (i = 0; s[i] != 0; i++) for (i = 0; s[i] != 0; i++) for (i = 0; s[i]; i++) for (i = 0; s[i]; i++) for (i = 0; s[i]; i++) oops for (i = 0; strings[i]; i++) for (i = 1; i <= N; i++) for (int i = 1; i <= 5; i++) for (p = first; p != 0; ) { for (p = first; p != 0; p = p->next) for (p = p0; *p; p++) for (p = root.next; p; p = p->next) for (p2p = strings; *p2p; p2p++) for (pos = 0; s[pos]; pos++) for (pos = 0; s[pos]; pos++) for (pos = 0; s[pos]; pos++) free(buf); free(mb); free(p); free(p); free(p); free(p); g(); g(); g(); g(); g(debug); g(p); getchar(); goto X; goto top; gprint(-100./-23); gprint(-100./23); gprint(-5.0/-3.0); gprint(-5.0/3.0); gprint(1.2 - 3); gprint(100./-23); gprint(100./23); gprint(1e4 + 1e7); gprint(34.0 / 3); gprint(34.0 / 3.0); gprint(5 * 7.7); gprint(5.0/-3.0); gprint(5.5 * 7.7); gprint(q); /* Inf with gcc */ i %= 2; // assigns 1 to i i *= 3; // assigns 15 to i i = sum3(j, k * 2, 50); if (!n) if (!p2) if ((c = getchar()) == -1) if ((remainder = nbytes % sizeof(double)) != 0) if (*a > *b) if (*label) if (*label) if (*p2p == 0) { if (++j % 1000000 == 0) if (/* if -d option specified */1) if (/* if -d option specified */1) if (0 == index) if (c == -1 && spos == 0) if (c == -1 && spos == 0) if (c == -1 && spos == 0) if (debug) if (debug) if (i > 0) if (i > 0) if (i > 10) if (index = 0) if (j == 5000000) if (my_heap_ptr - my_heap + nbytes <= sizeof(my_heap)) { if (n == 0) if (n == 1) if (n == 1) if (n) if (n) if (next != lines) { if (next == buf) { if (next == buf) { if (next_pool_addr - memory_pool + nbytes <= sizeof(memory_pool)) { if (p == 0) if (p1 != p2) if (p1 == p2) if (p1) if (p2 == 0) if (s == 0) if (which) int (*f)() = a; int *a = malloc(10 * sizeof(int)); int *a1 = m_to_n(100,100); int *a3 = m_to_n(1,3); int *a3a = m_to_n(-1,1); int *a5 = m_to_n(5,9); int *b = calloc(10, sizeof(int)); int *buf = m_to_n(1, N); int *buf = malloc((n - m + 1) * sizeof(*buf)); // Why *buf? int *c = calloc(10, sizeof(double)); int *lp = 0, i; int *p = &a[i-1]; int *p = &a[i]; int *p = &a[nelems]-1; int *p = &a[nelems]-1; int *p = a; int *p = a; int *p = buf; int *p = buf; int *p = larger(&i, &j); int *p = malloc(100 * sizeof(int)); int *p, i, a[5]; int *p1 = 1-1, *p2 = 2-2; int *p; int *p; int *pi = &i; int MAX_LINES = 100000; int N = 10; int N = 3; int N = atoi(args[1]); // No error handling int NLINES = 1000; int a = ((int*)&d1)[0]; int a = f(10); int a = f(10); int a[10]; int a[1]; int a[2], b[10], c[20]; int a[3]; int a[3]; int a[5], b[5]; int a[] = { -1 }; int a[] = { 1, 3, 4, 5, 7}; int a[] = { 10, 2}; int a[] = {0x48656c6c, 0x6f210000}; int a[] = {5, 19, 3, -16, 8, -12, -30, 5}; int a[n]; int b = ((int*)&d1)[1]; int b = f(0); int b = f(0); int b[g()]; int c = ((int*)&d2)[0]; int c = 0; int c, chunk_size = 2, len = chunk_size; int c, chunk_size = 2, len = chunk_size; int c, spos = 0; int c, spos = 0; int c, spos = 0; int c; int c; int c; int c; int c; int c; int count; int count; int d = ((int*)&d2)[1]; int debug = 0; int e, o; int entry_num; int f_i; int frompos = 0; int frompos = 0; int frompos = 0; int height; int height; int height; int height; int i = 0; int i = 0; int i = 0; int i = 0; int i = 0; int i = 0; int i = 10, j = 20; int i = 10, j = 20; int i = 10, j = 20; int i = 10, j; int i = 128; int i = 1; int i = 1; int i = 1; int i = 2; int i = 5, j = 9; int i = 5; int i = 7; int i, j, a[2]; int i, j; int i, w, h; int i1 = *(int*)&s[0]; int i2 = *(int*)&s[4]; int i; int i; int i; int i; int i; int i; int i; int i; int i; int i; int i; int i; int i; int i; int i; int i; int i; int i; int i; int i; int i; int i; int i; int i; int i; int i; int i; int i; int i; int i; int i; int i; int i; int i; int i; addr(i); int ii = c; int index; int j = 2; int j = 7, k = 5; int j = i * a; int j; int k = g(i, j); int len = 0; int len = 0; int len = 0; int len = 0; int len1 = strlen(s1); int main_i; int mb_size = sizeof(struct malloc_block); int mb_size = sizeof(struct malloc_block); int n = 10; int n = 1; int n = 1; int n = 5; int nbytes; int negated = -n; int num; int num_lines = 0, num_chars = 0; int one_billion = 1000000000; /* portable code? */ int p; int pos; int pos; int pos; int q2 = 1 / 0; int r = sum(3, 4); int r = sum(3, 4); int r = sum(3, 4); int r = sum(3, 4); int r = sum(3, 4); int r = sum(3, 4); int r = sum(3,4); int r = sum(a,b,c,d); int r = sum3(1, 2); int remainder; int result; int result; int serial; int sum = 0; int sum = 0; int sum = 0; int sum = 0; int sum = 0; int sum = 0; int sum = 0; int sum = 0; int sum = 0; int sum_of_areas = 0; int t = *ap; int tag; int tag; int ten = 10; int thirty = 036; int topos = 0; int topos = 0; int topos = 0; int total; int total_bytes = 0, num_mallocs = 0; int twenty = 0x14; int type; int type; int v; int v; int val; int val; int vals[] = {5, 2, 5, 3, -1, 4, 9, 9}; int value; int value; int values[10]; int which = 0; int width; int width; int width; int width; int x = 5; int x, y; int x, y; int x, y; ip++; iprint(!1.0); iprint(+(3 - 4)); iprint(-(3 - 4)); iprint(-1 || -2); iprint(-100/-23); iprint(-100/23); iprint(-13/4); iprint(-5%-3); iprint(-5%3); iprint(-5/-3); iprint(-5/3); iprint(1 < 2 ? 3 < 4 : 5); iprint(1 < 2 ? 3 < 4 : 5); iprint(1 ? 2 : 3); iprint(1 ? 2 : 3); iprint(1 || 0); iprint(100/-23); iprint(100/23); iprint(2 > 3 || 4 != 5); iprint(3 < 4 || i++); iprint(3 <= 4); // produces 1 iprint(3 > 4 || i++); iprint(34 % 3); iprint(34 / 3); iprint(4 + 7); iprint(5 * 7); iprint(5 == 10); iprint(5%-3); iprint(5%3); iprint(5.0 > 4.9); iprint(5/-3); iprint(i += 3); iprint(i); iprint(i); iprint(i); iprint(i); iprint(length("")); iprint(length("/\0999")); iprint(length("\\")); iprint(length("abc")); iprint(length(s1)); iprint(length(s2)); iprint(pos("", 'x')); iprint(pos("", 'x')); iprint(pos("abc", 'b')); iprint(pos("abc", 'b')); iprint(pos("abc", 'x')); iprint(pos("abc", 'x')); iprint(pos("abc", 979/10)); iprint(pos("abc", 979/10)); iprint(sizeof("/\0999")); iprint(sizeof(3 >= 4)); iprint(x == x + 1 || y == y - 2); iprint(x); len++; lets[5] = 0; lhs[0] = value; long long L; long long three_trillion = 3000000000000LL; long two_billion = 2000000000L; lp = make_line(1.0, 2.0, 3.0, 4.0); lp->p1.x = x1; lp->p1.y = y1; lp->p2.x = x2; lp->p2.y = y2; main() main(); make_name("William", "Hilton", "Mitchell", result); malloc_list[mb->entry_num] = 0; malloc_list[mb->entry_num] = mb; max_malloc++; mb->entry_num = get_slot(); mb->nbytes = nbytes; mb->serial = malloc_serial++; mb->tag = tag; memset(a, 0, 10 * sizeof(int)); memset(mb, '#', mb->nbytes + mb_size); n = 0; n = 3; node->count = 1; node->count = 1; node->next = 0; node->next = 0; node->tag = tag; node->total = nbytes; node->value = i; our_free(lines); our_malloc_stats("all done"); our_malloc_stats("done"); our_malloc_stats("done"); our_malloc_stats("lines allocated"); our_malloc_stats("lines printed"); our_malloc_stats("lines read"); our_malloc_stats("startup"); our_malloc_stats("startup"); our_malloc_stats("startup"); our_malloc_tally("all done, tallies:"); our_malloc_tally("done"); our_malloc_tally("done"); our_malloc_tally("lines printed, tallies:"); our_malloc_tally("lines read"); p = *p2p; // Or, char *p = *p2p; p2p = a; p2p++; pdigits(47819); peek-a-boo! print(p->left); print(p->right); print(root); printN(10); print_tallys(head); print_tallys(tally_head); printf("%3d\n", p->value); printf("%c%c%c%c%c", printf("%d %d %d %d\n", a,b,c,d); printf("%d allocations; %d total bytes\n", num_mallocs, total_bytes); printf("%d lines, %d characters\n", printf("%d, %d, %d\n", ten, twenty, thirty); printf("%d\n", 123.456); printf("%d\n", factorial(N)); printf("%d\n", i++); printf("%d\n", ii); printf("%d\n", length(s1)); printf("%d\n", length(s2)); printf("%d\n", p2p - a); printf("%d\n", sizeof(*&a)); printf("%d\n", sizeof(*&b)); printf("%d\n", sizeof(*vp)); printf("%d\n", sizeof(a)); printf("%d\n", sizeof(a)); printf("%d\n", sizeof(a)); printf("%d\n", sizeof(a)); printf("%d\n", sizeof(c = 1000)); printf("%d\n", sizeof(s1)); printf("%g\n", 123456); printf("%s\n", a[i]); printf("%s\n", b[i]); printf("%s\n", buf); printf("%s\n", buf); printf("%s\n", buf); printf("%s\n", buf); printf("%s\n", buf); printf("%s\n", buf); printf("%s\n", buf); printf("%s\n", buf); printf("%s\n", buf); printf("%s\n", p); printf("%s\n", replicate(i, 'A')); printf("%u\n", p); printf("%u\n", s); printf("%x %x\n", i1, i2); printf("%x\n", &p); printf("&L = %u\n", &L); printf("&N = %u\n", &N); printf("&a = %u\n", &a); printf("&a = %u\n", &a); printf("&a[0] = %u\n", &a[0]); printf("&a[0] = %u\n", &a[0]); printf("&a[0] = %u\n", &a[0]); printf("&a[0] = %u\n", &a[0]); printf("&a[0] = %u\n", &a[0]); printf("&a[1] = %u\n", &a[1]); printf("&a[1] = %u\n", &a[1]); printf("&a[1] = %u\n", &a[1]); printf("&conductors = %u\n", &sc.conductors); printf("&ends = %u\n", sc.ends); printf("&f_i = %u\n", &f_i); printf("&gi1 = %u\n", &gi1); printf("&gi2 = %u\n", &gi2); printf("&gld2 = %u\n", &gld1); printf("&i = %u, &j = %u\n", &i, &j); printf("&i = %u, &j = %u\n", &i, &j); printf("&i = %u, &j = %u\n", &i, &j); printf("&i = %u, i = %d, pi = %u\n", &i, i, pi); printf("&i = %u\n", &i); printf("&i = %u\n", &i); printf("&i = %u\n", &i); printf("&i = %u\n", &i); printf("&j = %u\n", &j); printf("&length = %u\n", &sc.length); printf("&main = %u\n", &main); printf("&main_i = %u\n", &main_i); printf("&manufacturer = %u\n", &sc.manufacturer); printf("&n = %u\n", &n); printf("&n = %u\n", &n); printf("&p = %u\n", &p); printf("&printf = %u\n", &printf); printf("&result = %u\n", &result); printf("&result = %u\n", &result); printf("&s = %u\n", &s); printf("&s = %u\n", &s); printf("&s = %u\n", &s); printf("&s[0] = %u\n", &s[0]); printf("&s[0] = %u\n", &s[0]); printf("&values[0] = %u\n", &values[0]); printf("&x = %u\n", &x); printf("'a' = %d, '$' = %d\n", 'a', '$'); printf(">%s<\n", a); printf("All done!\n"); printf("Back from f()!\n"); printf("Call: sum3(%d, %d, %d)\n", a, b, c); printf("In f, sizeof(values) = %d\n", sizeof(values)); printf("In negate, &n = %u, &negated = %u\n", &n, &negated); printf("In sum, &a = %u, &b = %u, &result = %u\n", &a, &b, &result); printf("In sum, &a = %u, &b = %u\n", &a, &b); printf("In sum, &a = %u, &b = %u\n", &a, &b); printf("On this machine, an int occupies %d bytes.\n", printf("Process complete; %d box%s filled.\n", n, n > 1 ? "es":""); printf("Process complete; %d box%s filled.\n", n, n > 1 ? "es":""); printf("Rectangle %d: %d x %d\n", printf("Sum of areas: %d\n", sum_of_areas); printf("The first byte is %c (%d)\n", c, c); printf("The longest word is '%s'\n", *lng); printf("The longest word is '%s'\n", *lng); printf("The sum is %d\n", sum3(sum3(1,2,3),4,sum3(5,6,7))); printf("\n"); printf("\n"); printf("\n"); printf("\n"); printf("a = %d, b = %d\n", a, b); printf("a = %d\nb = %d\n", a, b); printf("a = %d\nb = %d\n", a, b); printf("a = %f, b = %f\n", a, b); printf("a = %u\n", a); printf("a = %u\n", a); printf("a at %p\n", &s1.u.a); printf("a[%d] = %d\n", i, a[i]); printf("a[0] = %d, a[1] = %d\n", a[0], a[1]); printf("b = >%s<\n", b); printf("b = >%s<\n", b); printf("b = >%s<\n", b); printf("c = %d (%c), f = %g\n", c, c, f); printf("c = %d, c = %u, c = %x\n", c, c, c); printf("c1 = %c, c2 = %c, c3 = %c\n", c1, c2, c3); printf("c2 = %d, c2 = %u, c2 = %x\n", c2, c2, c2); printf("done, p = %u, *p = %c, len = %d\n", p, *p, len); printf("dp = %u\n", dp); printf("evens = %d, odds = %d\n", e, o); printf("f(%c)\n", c); printf("f(%s)\n", p); printf("f() returning...\n"); printf("f()\n"); printf("hello, world\n"); printf("hello, world\n"); printf("i = %d, j = %d, k = %d\n", i, j); printf("i = %d, j = %d, x = %g, y = %g\n", i, j, x, y); printf("i = %d, j = %d\n", i, j); printf("i = %d, j = %d\n", i, j); printf("i = %d, p = %x\n", i, p); printf("i = %d, x = %g, i + x = %d\n", x, i, i + x); printf("i = %d\n", i); printf("i is %d in f2\n", xp->i); printf("ip = %u\n", ip); printf("k = %d\n", f(3)); printf("let_a = %d, dollar = %d, 'b' = %d\n", printf("n = %d\n", n++); printf("new slope of A = %g\n", Slope(A)); printf("p = %u\n", p); printf("p = %x (%u)\n", p, p); printf("p[%d] = %d\n", i, p[i]); printf("q = %g\n", q); printf("q2 = %d\n", q2); printf("r = %d\n", r); printf("r = %d\n", r); printf("r = %d\n", r); printf("r = %d\n", r); printf("r = %d\n", r); printf("r = %d\n", r); printf("r = %d\n", r); printf("r = %d\n", r); printf("r = %d\n", r); printf("s = %u\n", s); printf("s = '%s' (%d)\n", s, length(s)); printf("s = >%s<\n", &s[504]); printf("s = >%s<\n", s); printf("s = >%s<\n", s); printf("s = >%s<\n", s); printf("s at %p\n", &s1.u.s); printf("sizeof('a') = %d\n", sizeof('a')); printf("sizeof(3) = %d\n", sizeof(3)); printf("sizeof(3.0) = %d\n", sizeof(3.0)); printf("sizeof(3.0F) = %d\n", sizeof(3.0F)); printf("sizeof(3.0L) = %d\n", sizeof(3.0L)); printf("sizeof(3LL) = %d\n", sizeof(3LL)); printf("sizeof(\"\\0\\0\\0\") = %d\n", sizeof("\0\0\0")); printf("sizeof(a) = %d\n", sizeof(a)); printf("sizeof(a) = %d\n", sizeof(a)); printf("sizeof(b) = %d\n", sizeof(b)); printf("sizeof(char) = %d\n", sizeof(char)); printf("sizeof(float) = %d\nsizeof(double) = %d\n" printf("sizeof(float) = %d\nsizeof(double) = %d\n" printf("sizeof(int) = %d\n", sizeof(int)); printf("sizeof(long long) = %d\n", sizeof(long long)); printf("sizeof(long) = %d\n", sizeof(long)); printf("sizeof(r) = %d\n", sizeof(r)); printf("sizeof(s) = %d\n", sizeof(s)); printf("sizeof(sc) = %d\n", sizeof(sc)); printf("sizeof(short) = %d\n", sizeof(short)); printf("sizeof(struct Rectangle) = %d\n", sizeof(struct Rectangle)); printf("sizeof(struct SerialCable) = %d\n", sizeof(struct SerialCable)); printf("slope of A = %g\n", Slope(A)); printf("strlen(s) = %d\n", strlen(s)); printf("sum = %d\n", sum(nums, sizeof(nums)/sizeof(nums[0]))); printf("sum = %d\n", sum(nums, sizeof(nums)/sizeof(nums[0]))); printf("sum = %d\n", sum(nums, sizeof(nums)/sizeof(nums[0]))); printf("sum = %d\n", sum(nums, sizeof(nums)/sizeof(nums[0]))); printf("this is f1, i = %d\n", xp->i); printf("vals[%d] = %g\n", i, vals[i]); printf("value = %g\n", 1076407828, 2061584302); printf("x = %d\n", x); printf("x at %p\n", &s1.u.x); printf("xs = '%s'\n", xs); printf("y = %d\n", y); pstring("testing\n"); pstring(&"biscuit"[5]); pstring(&string_literal1[3]); pstring(buf); pstring(greeting); pstring(greeting2); pstring(greeting3); pstring(string_literal1); putchar(c); putchar(c); puts(""); puts("x"); puts(*++p2p); puts(*p2p); puts(a); puts(b); puts(lets); puts(p1); puts(result); result = a + b; result = a + b; result = negate(a + b); return "testing"; return &L; return (L.p2.y - L.p1.y) / (L.p2.x - L.p1.x); return (void*)mb + mb_size; return *p; return -1; return -1; return -1; return -1; return 0; return 7; return a + b; return a + b; return a + b; return a + b; return a + b; return a + b; return a + b; return a + b; return a + b; return buf; return buf; return buf; return buf; return buf; return c; return i+j; return i; return k; return len; return len; return len; return longest; return longest; return lp; return lp; return p - p0; return p - s; // p - &s[0] return result; return result; return result; return result; return result; return s[0]; return spos; return spos; return spos; return sum; return sum; return sum; return sum; return sum; return sum; return sum; return sum; return sum; return v; return v; return val; return val; return; return; return; rev_line(); rp->height = h; rp->width = w; s = 0; s2.type = 2; s[i] = 0; s[i] = 0; s[i] = 0; s[spos] = 0; s[spos] = 0; s[spos] = 0; sc.conductors = 9; sc.ends[0] = 'M'; sc.ends[1] = 'F'; sc.length = 5.5; sc.manufacturer = "Cables 'R Us"; snprintf(result, 3, "%s %c. %s", first, middle[0], last); sprintf(result, "%s %c. %s", first, middle[0], last); sscanf(argv[1], "%x", &p); static char *last; static int len = strlen(s); static int n; static int s; strcpy(&result[len1], s2); strcpy(p, p+1); strcpy(result, s1); strcpy(s2.u.s, "testing"); strncat(lets, "xyzpdq", 4); struct Line *lp = malloc(sizeof(struct Line)); struct Line *lp; struct Line A = {{},{2,4}}; struct Line L = {{x1,y1},{x2,y2}}; struct LineNode *next; struct LineNode root = { "", 0 }, *p; struct Point p[2]; struct Rectangle r; struct Rectangle rects[5]; struct SerialCable sc; struct malloc_block *mb = struct malloc_block *mb; struct node *left; struct node *right; struct node *root; struct sym s1 = { 1, {2} }, s2, s3 = {2, {'a', 'b', 'c', 0}}; struct tally_node **next_field_addr = head; struct tally_node **next_field_addr = head; struct tally_node *next; struct tally_node *next; struct tally_node *node = malloc(sizeof(struct tally_node)); struct tally_node *node = malloc(sizeof(struct tally_node)); struct tally_node *p; struct tally_node *p; struct tally_node *tally_head = 0; sum(10,20); sum(10,20); sum(10,20); sum(10,20); sum(1072693248,0,1073741824,0); sum(i, j); sum(i, j); sum_of_areas += rp->width * rp->height; switch (p->type) { tally_eo(a, sizeof(a)/sizeof(a[0]), &e, &o); to[i] = 0; to[i] = 0; to[i] = 0; to[topos++] = 0; to[topos++] = 0; to[topos++] = 0; union { union { uprint(p = &i); uprint(p = &j); val = a + b + c; val = a + b + c; vals[i] = i*i; value a[10]; void (*f)(struct X*); void *vp; void f(char s[]) while ((c = getchar()) != -1) while ((c = getchar()) != -1) { while ((c = getchar()) != -1) { while ((c = getchar()) != -1) { while ((c = getchar()) != -1) { while ((c = getchar()) != -1) { while ((c = getchar()) != -1) { while ((c = getchar()) != -1) { while ((c = getchar()) != -1) { while (**p2p == c) while (*next_field_addr) { while (*next_field_addr) { while (*p == c) while (*p) while (*p) while (*p) while (*p) { while (*p) { while (*to) while (*to++ = *from++) while (*to++ = *from++) while (--next_ent >= lines) { while (1) while (1) { while (1) { while (1) { while (N--) while (c < 128) { while (f(*p++)) { while (front < end) { while (front < end) { while (getline(line) != -1) { while (getline(line) != -1) { while (gets(line)) while (gets(line)) { // read a line into line while (gets(line)) { while (i < 7) while (line = readline()) { while (line = readline()) { while (m <= n) while (n--) while (n--) while (n--) while (n--) while (n--) while (n--) while (n--) while (nelems--) while (nelems--) while (p < &a[nelems]) while (p = readline()) { while (p = readline()) { while (p >= a) while (s[len]) while (s[len]) while (s[len]) while (scanf("%d ", &num) == 1) while (size--) while (size--) while (to[i] = from[i]) while (to[i] = from[i]) while (to[i] = from[i]) while (to[topos++] = from[frompos++]) while (to[topos++] = from[frompos++]) while (to[topos++] = from[frompos++]) while (to[topos]) while (to[topos]) while (to[topos]) x = 1; x1.f(&x1); x2.f(&x2); y = (x + 2) * (x = 3); yikes { { { { { { { { { 't', 'e', 's', 't', 'i', 'n', 'g', '\n', '\0' }; { .conductors = 3, .length = 2.0, .manufacturer = "Kinky Kables" }, { .ends = 'M' } { 1.5, 3, {'M', 'M'}, "Joe's Cables" }, { 2.5, 9, 'M', 'F', "Cables 'R Us" }, { 4.0, 3, {'F', 'M'}, "connectem.com" } { 72, 'e', 108, 25*4+8, 0x6F, '\041', sizeof("abcd")*2, 0}; { 72, 101, 108, 108, 111, 33, 10, 0}; {int x = !p2;} } } } } } } } } } } } } } } } } } } } X; }; }; }; }; }; }; }; }; }; }; }; }; }; }; { 'H', 'e', 'l', 'l', 'o', '!', '\n', '\0' }; printf("%d\n",sizeof(int)); printf("%d\n",sizeof(long long)); printf("%d\n",sizeof(long)); " to underscores:\n", first - s, last - s); #define MAX_MALLOCS 1000000 #define _strfuncs_c_ #define _strfuncs_c_ #define _strfuncs_c_ #define addr(i) printf("&" #i " = %u\n", &i) #define addr(i) printf("&" #i " = %u\n", &i) #define addr(i) printf("&" #i " = %u\n", &i) #define addr(i) printf("&" #i " = %u\n", i) #define addr(i) printf("&" #i " = %u\n", i) #define free our_free #define free our_free #define gprint(e) fputs(#e, stdout); fprintf(stdout, " = %g\n", e) #define gprint(e) fputs(#e, stdout); fprintf(stdout, " = %g\n", e) #define gprint(e) fputs(#e, stdout); fprintf(stdout, " = %g\n", e) #define gprint(e) fputs(#e, stdout); fprintf(stdout, " = %g\n", e)main() #define iprint(e) fputs(#e, stdout); fprintf(stdout, " // %d\n", e) #define iprint(e) fputs(#e, stdout); fprintf(stdout, " // %d\n", e) #define iprint(e) fputs(#e, stdout); fprintf(stdout, " // %d\n", e) #define iprint(e) fputs(#e, stdout); fprintf(stdout, " = %d\n", e) #define iprint(e) fputs(#e, stdout); fprintf(stdout, " = %d\n", e) #define iprint(e) fputs(#e, stdout); fprintf(stdout, " = %d\n", e) #define iprint(e) fputs(#e, stdout); fprintf(stdout, " = %d\n", e) #define iprint(e) fputs(#e, stdout); fprintf(stdout, " = %d\n", e) #define iprint(e) fputs(#e, stdout); fprintf(stdout, " = %d\n", e) #define iprint(e) fputs(#e, stdout); fprintf(stdout, " = %u\n", e) #define malloc(n) our_malloc((n),__LINE__) #define malloc(n) our_malloc((n),__LINE__) #define uprint(e) fputs(#e, stdout); fprintf(stdout, " // %u\n", e) #define uprint(e) fputs(#e, stdout); fprintf(stdout, " // %u\n", e) #define uprint(e) fputs(#e, stdout); fprintf(stdout, " // %u\n", e) #endif #endif #endif #endif #if 0 #ifndef _strfuncs_c_ #ifndef _strfuncs_c_ #ifndef _strfuncs_c_ #include "/home/cs352/fall04/a4/strfuncs.c" #include "a_print.c" #include "a_print.c" #include "a_print.c" #include "a_print.c" #include "our_malloc.h" #include "our_malloc.h" #include "our_malloc.h" #include "our_malloc.h" #include "strfuncs.c" #include "strfuncsp.c" #include "strfuncsp.c" #include "string.c" #include "string.c" #include "string.c" #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include &a[-1] - &a[0], // Undefined: a[-1] is not in a &a[10] - &a[0]}; // Undefined: a[10] is not in a &a[3] - &a[0], // OK &a[5] - &a[0], // OK: a[5] is "one past" */ */ */ */ */ *first = '_'; *last = '_'; *p1 = *p2; *p1 = 15; /* /* /* /* /* /*factorial(20);*/ /*printf("%d\n", i++ + i);*/ // printf("%s%s%s\n", replicate(i, 'A'), replicate(i, '.'), // replicate(i, 'A')); //!gprintf("slope = %g\n", slope); //#include "/home/cs352/fall04/a4/strfuncs.c" //#include "/home/cs352/fall04/a4/strfuncs.c" ///* //10 = 20; //assign(0x80000000, 1); //char **longest(char *strings[]) //char **longest(char *strings[]) //char *p1 = allocate(0); //char memory_pool[1000000]; //concat(s, " testing"); //concat(s, " testing"); //cp = ip; //double slope = (L.p2.y - L.p1.y) / (L.p2.x - L.p1.x); //for (;;) { //for (i = 0; i < sizeof(nums)/sizeof(nums[0]); i++) //int *p2 = allocate(0 * sizeof(int)); //int area = r.width * r.height; //ip = &c; //iprint(& &i); //null is NULL //p = realloc(p, (strlen(p)+1)*sizeof(char)); //printf("%d\n", area); //printf("%d\n", sizeof(r)); //printf("%d\n", sizeof(struct Rectangle)); //printf("p1 = %u, p2 = %u\n", p1, p2); //printf("sum = %d\n", sum(nums, N)); //ptrdiff_t x; //r.height = 20; //r.width = 10; //struct SerialCable cable3 = { 5.0, 9, 'M', "Joe's Cables" }; //x + y = 5; L.p1.x = 1; L.p1.y = 1; L.p2.x = 3; L.p2.y = 4; L.p[0].x = 1; L.p[0].y = 1; L.p[1].x = 3; L.p[1].y = 4; T *pt = (T*)1000; X: a_print(&rvals[6], 4); a_print(&vals[0], N); a_print(a, 10); a_print(a, 10); a_print(a, 5); a_print(a, 5); a_print(a, N); assert(p); assign(&i, 0); assign(&i, 0); assign(0x80000000, 1); char **longest(char **strings) char **longest(char *strings[]) char *As = replicate(5, 'A'); char *As = replicate(5, 'A'); char *a = "concat"; char *a[] = { "XX", "XIX", "XVIII" }; char *b = concat(a, "enate"); char *b[] = { s, s+1, &s[2], a[1], a[2]+2, 0 }; char *concat(char *s1, char *s2) char *cp; char *cp; float *fp; char *dots = replicate(3, '.'); char *dots = replicate(3, '.'); char *f() char *fill(char s[], char c, int n) char *first = strchr(s, ' '); char *last = strrchr(s, ' '); char *last, char *result) char *last, char *result) char *last, char *result) char *my_heap_ptr = my_heap; char *next_pool_addr = memory_pool; char *p = malloc(100 * sizeof(char)); char *p = malloc(1000); char *p = s; char *p = s; char *p1 = allocate(0); char *p2; char *p; char *pos2(char *p, char c) // SKIP char *readline() char *readline() char *readline(); char *readline(); char *readline(); char *replicate(char c, int n) char *replicate(int n, char c) char *replicate(int n, char c) char *s = "...oops!"; char *s = "abcd"; char *strtok(char *s, char *delims) char As[6]; char As[6]; char buf[5]; char c1 = *a[0]; char c2 = *p; char c; char c; char dots[4]; char dots[4]; char f(char *p) char f(char s[]) char fmt[] = { '%', 's', 0 }; char greeting2[ ] = char greeting3[ ] = char greeting[ ] = char greeting[ ] = { 'H', 'e', 'l', 'l', 'o', '!', '\n', '\0' }; char lets[] = "abcdef"; char memory_pool[56]; char my_heap[1000000]; char s[100]; char s[100]; char s[5]; char s[] = "To be or not to be"; char s[] = "test"; char string_literal1[] = char x[10]; concat(&s[2], "icy"); concat(&s[2], "icy"); concat(s, "x"); concat(s, "x"); copy(s, "just"); copy(s, "just"); cp = vp; done: double *dp = a2; double Slope(struct Line L) double a2[] = {1.0, 2.0, 3.0}; double dcube(double n); double slope = (L.p2.y - L.p1.y) / double slope = (L.p[1].y - L.p[0].y) / (L.p[1].x - L.p[0].x); double sum(double a, double b) double sum(double a, double b) { return a + b; } double sum(double a, double b); double sum(double a, double b); double vals[5] = {1.23, 1e2, .023, 7.5, 1e-2}; f() f() f(); f(int a, int b) fill(As, 'A', 5); fill(As, 'A', 5); fill(dots, '.', 3); fill(dots, '.', 3); fill(s, 'x', 99); for (;;) { for (assign(&i,0); i < 5; assign(&i, i + 1)) for (assign(&i,0); i < 5; assign(&i, i + 1)) for (i = -1; i >= -3; i--) { for (i = 0; b[i]; i++) for (i = 0; i < 10; i++) for (i = 0; i < 10; i++) for (i = 0; i < 20; i++) { for (i = 0; i < 3; i++) { for (i = 0; i < 3; i++) { for (i = 0; i < 5; i++) for (i = 0; i < N; i++) for (i = 0; i < N; i++) for (i = 0; i < N; i++) for (i = 0; i < N; i++) for (i = 0; i < N; i++) for (i = 0; i < N; i++) { for (i = 0; i < sizeof(a)/sizeof(a[0]); i++) for (i = 0; i < sizeof(a)/sizeof(a[0]); i++) for (i = 0; i < sizeof(nums)/sizeof(int); i++) for (i = 0; i < sizeof(vals)/sizeof(vals[0]); i++) for (i = 1; i < 20; i++) for (i = 1; i < 20; i++) { for (i = 1; i <= 20; i++) { for (i = 1; i <= N; i++) { for (rp = rects, w = 3, h = 4; for (rp = rects; rp < &rects[sizeof(rects)/sizeof(*rp)]; rp++) free(p); free(p); free(x); g() i = &i; i = (int)&i; i = i++; if (p == 0) { int *ip = a1; int *ip; int *larger(int *a, int *b) int *largest_negative(int a[], int size) int *m_to_n(int m, int n) int *p = malloc(10 * sizeof(int)); int *p, i; int *p0 = &a[0]; int *p1 = &i, *p2 = &j; int *p1, *p2; int *p2 = allocate(0 * sizeof(int)); int *p3, *p4; int *p4 = &a[4]; int *p; int *p; int N = 10, i, vals[N], rvals[N]; int N = 5; // Down the road: const int N = 5 int N = 5; // Down the road: const int N = 5 int N = 5; // Down the road: const int N = 5 int N = 5; // Down the road: const int N = 5 int a, b; int a1[] = {1, 2, 3}; int a; int a[10] = {10, 2, 4}; int a[10], i; int a[10], i; int a[5] = {1}; int a[5]; int a[5]; int a[5]; int a[] = { int b[2] = {10, 2, 4}; int c; int c; int cube(int n); int cube(int n); int debug = 0; int f(char c) int f(int a) int f(int a, int b, int c, int d) int f(int i) int f(int i) int factorial(int n) int factorial(int n) int factorial(int); int factorial(int); int g() int g() { int a = 99; } int g() { int g_a = 99; addr(g_a); } int g(); int g(int i, int j) int getline(char s[]) int getline(char s[]) int getline(char s[]) int gi1; int gi2; int i = 5; int i = 7 , *p = &i; int i = 7, j = 11, a[2]; int i = 7; int i, N = 5, a[N]; int i, j = 7; int i, j; int i, nums[5]; int i, nums[N]; int i, nums[N]; int i, nums[N]; int i, nums[N]; int i; int i; int i; int i; int i; int i; int i; int i; int i; int i; int i; int i; int j = 0; int j; int j; int len = 0; int length(char *p) // SKIP int length(char s[]) int length(char s[]) int length(char s[]) int length(char s[]) int ncables = sizeof(cables) / sizeof(cables[0]); int negate(int n) int negate(int); int pos(char *p0, char c) int pos(char s[], char c) int pos(char s[], char c) int pos(char s[], char c) int printf(char format[], ...); int printf(char format[], ...); int r = snprintf(buf, sizeof(buf), "%d", 123456789); int rev_line() int rsum(int a[], int nelems) int rsum(int a[], int nelems) int rsum(int a[], int nelems); int rsum(int a[], int nelems); int s2 = seconds_in_day * 2; int seconds_in_day = 24*60*60; int sum = 0; int sum(); int sum(double a, double b) int sum(double a, double b) int sum(double a, double b) int sum(double a, double b) int sum(double a, double b) int sum(double a, double b); int sum(double a, int b); int sum(int N) int sum(int a, int b) int sum(int a, int b) int sum(int a, int b); int sum(int a, int b); int sum(int a[ ], int nelems) int sum(int a[ ], int nelems) int sum(int a[ ], int nelems) int sum(int a[], int nelems) int sum(int a[], int nelems) int sum(int a[], int nelems); int sum(int a[], int nelems); int sum(int a[], int nelems); int sum(int a[], int nelems); int sum(int a[], int nelems); int sum(int n) int sum2(int *a, int nelems) int sum3(a, b, c) int sum3(int a, int b, int c) int sum_of_areas = 0; int w, h; int x = h(); int x; ip = vp; iprint(&*&*p); iprint(&*&i); iprint(&*p); iprint(&a[2]); iprint(&i); iprint(&p); iprint(*&*&*p); iprint(*&*p); iprint(*&a[1]); iprint(*&i); iprint(*p); iprint(7); iprint(a[0]); iprint(i); iprint(p); iprint(sizeof(*(void *)0)); iprint(sizeof(char *)); iprint(sizeof(char)); iprint(sizeof(double *)); iprint(sizeof(double)); iprint(sizeof(int *)); iprint(sizeof(int)); iprint(sizeof(long long *)); iprint(sizeof(long long)); iprint(sizeof(long)); iprint(sizeof(void *)); iprint(sizeof(void)); j = *p2; long double gld1; main() main() main() main() main() main() main() main() main() main() main() main() main() main() main() main() main() main() main() main() main() main() main() main() main() main() main() main() main() main() main() main() main() main() main() main() main() main() main() main() main() main() main() main() main() main() main() main() main() main() main() main() main() main() main() main() main() main() main() main() main() main() main() main() main() main() main() main() main() main() main() main() main() main() main() main() main() main() main() main() main() main() main() main() main() main() main() main() main() main() main() main() main() main() main() main() main() main() main() main() main() main() main() main() main() main() main() main() main() main() main() main() main() main() main() main() main() main() main() main() main() main() main() main() main() main() main() main() main() main() main() main() main() main() main() main() main() main() main() main() main() main() main() main() main() main() main() main() main() main() main() main() main() main() main() main() main() main() main() main() main() main() main(int argc, char **argv) main(int argc, char *args[]) main(int argc, char *argv[]) main(int argc, char *argv[]) main(int argc, char *argv[]) p = &*a[2]; p = &c; p = &i; p = &j; p = (int*)1000; p = 0; p = 1000; p = realloc(p, 100); p++; p1 = &i; p2 = &i; p2 = p1; p3 = &*p1; p4 = &*p2; p[-1] = 100; p[p[-1]] = 200; printf("%d\n", (char *)100 + 1); printf("%d\n", (char *)100 - 1); printf("%d\n", (double *)100 + 4); printf("%d\n", (double *)100 - 20); printf("%d\n", (int *)100 + 3); printf("%d\n", (int *)100 - 10); printf("%d\n", (short *)100 + 2); printf("%d\n", (short *)100 - 5); printf("%d\n", i); printf("%d\n", i); printf("%d\n", len); printf("%d\n", ncables); printf("%d\n", sizeof(L)); printf("%d\n", sizeof(p4 - p0)); printf("%d\n", sizeof(struct Line)); printf("%d\n", sizeof(struct Point)); printf("%s (%u)\n", &lets[0], &lets[0]); printf("%s (%u)\n", &lets[3], &lets[3]); printf("%s (%u)\n", lets, lets); printf("%s", greeting); printf("%s%s%s\n", As, dots, As); printf("%s%s%s\n", As, dots, As); printf("%s\n", b); printf("%s\n", concat(b,b)); printf("%u %u\n", pt + 5, (int)pt + 5*sizeof(*pt)); printf("&L.p1.x = %u\n", &L.p1.x); printf("&L.p1.y = %u\n", &L.p1.y); printf("&L.p2.x = %u\n", &L.p2.x); printf("&L.p2.y = %u\n", &L.p2.y); printf("&i = %u\n", &i); printf("&i = %u\n", &i); printf("&j = %u\n", &j); printf("&p = %u\n", &p); printf("&r1 = %u\n", &r1); printf("&r1.height = %u\n", &r1.height); printf("&r1.width = %u\n", &r1.width); printf("&r2 = %u\n", &r2); printf("&r2.height = %u\n", &r2.height); printf("&r2.width = %u\n", &r2.width); printf("++i = \t%d\n", ++i); printf("Changed blanks at positions %d and %d" printf("Sum of areas: %d\n", sum_of_areas); printf("\n"); printf("\t%s\n", s); printf("a[0] = %d, a[1] = %d\n", a[0], a[1]); printf("a[2] = %s\n", a[2]); printf("buf = '%s', r = %d\n", buf, r); printf("c1 = %c\n", c1); printf("c2 = %c\n", c2); printf("i = %d, j = %d\n", i, j); printf("i = %d, j = %d\n", i, j); printf("i = %d, j = %d\n", i, j); printf("i = %d, j = %d\n", i, j); printf("i = %d\n", i); printf("i = %d\n", i); printf("i = %d\n", i); printf("i = \t%d\n", i); printf("i = \t%d\n", i); printf("i++ = \t%d\n", i++); printf("j is at %u\n", p); printf("p = %d\n", p); printf("p = %d\n", p); printf("p = %u\n", p); printf("p0 - p4 = %d\n", p0 - p4); printf("p0 = %u\n", p0); printf("p1 = %u, p2 = %u\n", p1, p2); printf("p4 - p0 = %d\n", p4 - p0); printf("p4 = %u\n", p4); printf("rsum = %d\n", rsum(nums, N)); printf("rsum = %d\n", rsum(nums, N)); printf("s = '%s'\n", s); printf("s = >%s<\n", s); printf("s = >%s<\n", s); printf("s = >%s<\n", s); printf("s = >%s<\n", s); printf("sizeof(primes) = %d\n", sizeof(primes)); printf("slope = %g\n", slope); printf("slope = %g\n", slope); printf("sum = %d\n", sum(nums, N)); printf("sum = %d\n", sum(nums, N)); printf("sum = %d\n", sum(nums, N)); printf("sum = %d\n", sum(nums, N)); printf("sum = %d\n", sum); printf("sum2 = %d\n", sum2(nums, N)); printf(fmt, greeting); pstring("\n"); pstring("testing\n"); pstring(&"biscuit"[5]); pstring(&string_literal1[0]); pstring(&string_literal1[3]); pstring(greeting); pstring(s); pstring(string_literal1); putchar(*a[1]); puts("freed(x)"); puts(p); puts(p); recycle: reverse(&vals[2], &rvals[5], 4); sd main() short primes[] = { 3, 5, 7, 11, 13 }; skip(&p, '.'); skip(&p, 'o'); static int get_slot() static int malloc_serial = 0; static int max_malloc = 0; static struct malloc_block *malloc_list[MAX_MALLOCS]; static void print_tallys(struct tally_node *first) static void tally(int tag, int nbytes, struct tally_node **head) strcpy(p, "abc"); strcpy(p, "testing"); struct Line *make_line(double x1, double y1, double x2, double y2) struct Line *make_line0(double x1, double y1, double x2, double y2) struct Line L1 = {{1, 2}, {3, 4}}; struct Line L2 = {1, 1, -1, -1}; struct Line L3 = {{}, 5, 7}; struct Line L; struct Line L; struct Line a[] = {{1,2}, {}, {3,4}}; struct Line { struct Line { struct Line { struct Line { struct Line { struct LineNode { struct Point Translate(struct Point p, struct Point { struct Point { struct Point { struct Point { struct Point { struct Rectangle *rp; struct Rectangle r1, r2; struct Rectangle rects[5]; struct Rectangle { struct Rectangle { struct Rectangle { struct Rectangle { struct SerialCable cable1 = { 1.5, 3, {'M', 'M'}, "Joe's Cables" }; struct SerialCable cable2 = { 2.5, 9, 'M', 'F', "Joe's Cables" }; struct SerialCable cables2[] = { struct SerialCable cables3[] = {{1},{2},{3},{4},{5}}; struct SerialCable cables4[] = { struct SerialCable cables[] = { struct SerialCable { struct SerialCable { struct malloc_block { struct node { struct sym { struct tally_node *head; struct tally_node { struct tally_node { struct { sum(double a, double b) sum(double a, double b) sum(int a, float b) sum(int a, int b) swap(&i, &a[0]); swap(&i, &j); swap(&j, &a[1]); top: typedef char T; typedef char value; typedef struct X { uprint( p = &a[0]); uprint( p = &a[1]); uprint( p = a); void *allocate(int nbytes) void *allocate(int nbytes) void *allocate(int nbytes); void *allocate(int nbytes); void *our_malloc(int nbytes, int tag) void *vp = &c; void a_print(int *p, int size) void a_print(int *p, int size) void a_print(int a[], int size) void a_print(int a[], int size) void a_print(int a[], int size); void a_print(int a[], int size); void ask_politician() void ask_politician() void assign(int *lhs, int value) void assign(int *lhs, int value) void assign(int lhs[], int value) void concat(char *to, char *from) void concat(char to[], char from[]) void concat(char to[], char from[]) void concat(char to[], char from[]) void copy(char *to, char *from) void copy(char to[], char from[]) void copy(char to[], char from[]) void copy(char to[], char from[]) void f() void f() void f() void f() void f() { printf("f() called\n"); }; void f(char *p) void f(int *a) void f(int a) void f(int a); void f(int a[]) void f(int a[]); void f(int a[]); void f(int debug) void f(int n) void f(int n); void f(int values[]) void f(int), g(int); void f(struct sym *p) void f(void), g(void); void f(void); void f(void); void f1(X* xp) void f1(value a[]) void f2(X* xp) void f2(int a, char b); void f2(value *a) void f3(int a, char b, float c); void fill(char s[], char c, int n) void fill(char s[], char c, int n) void fill(char s[], char c, int n) void fill(char s[], char c, int n) void fill(char s[], char c, int n) void fill(char s[], char c, int n) void g() void g(char *p) void g(int debug) void gchar() void hello() void insert(struct node **p2p, int value) void main() void main() void main() void make_name(char *first, char *middle, void make_name2(char *first, char *middle, void make_name3(char *first, char *middle, void our_free(void *block) void our_malloc_stats(char *label) void our_malloc_tally(char *label) void pchar() void pdigits(int n) void print(struct node *p) void printN(int); void print_tallys(struct tally_node *first) void pstring(char *p) void pstring(char s[]) void pstring(char s[]) void pstring(char s[]) void pstring(char s[]) void pstring(char s[]) void pstring(char s[]); void pstring(char s[]); void release(void *block_addr) void reverse(char *front) void reverse(char *front) void reverse(int a[], int b[], int size) void reverse(int a[], int b[], int size) void reverse(int a[], int b[], int size); void reverse(int a[], int b[], int size); void skip(char **p2p, char c) void skip0(char **p2p, char c) void swap(int *ap, int *bp) void tally(int i, struct tally_node **head) void tally_eo(int a[], int size, int *evens, int *odds) vp = &i; while (*p++) { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } }