This feed contains pages with tag "C".
Chapter 15, multiple compilation units, include files, makefile
Chapter 15, multiple compilation units, include files
Chapter 17 variable sized structs. Chapter 15, multiple compilation units, include files
Chapter 17 Dynamic memory allocation, linked lists, variable sized structs
Chapter 17 Dynamic memory allocation, linked lists
Fill in the three missing functions in this code, so that numbers are printed out in order. Note that you can debug print_numbers independently.
#include <stdio.h> #include <stdlib.h> struct node { int value; struct node *next; }; struct node *read_numbers(void){ struct node *first = NULL; int n; printf("Enter a series of integers" " (0 to terminate): "); for (;;) { scanf("%d", &n); if (n == 0) return first; first = add_to_list(first, n); } } struct node *reverse(struct node *list){ } struct node *add_to_list(struct node *list, n){ } void print_numbers(struct node *list){ } int main(void){ struct node *list=NULL; list=read_numbers(); list=reverse(list); printf("output: \n"); print_numbers(list); }
Chapter 17 Dynamic memory allocation
Chapter 16,17 Enumerations, Pointers
Chapter 16 Structures, Unions
Chapter 16 Structures
Chapter 14 Preprocessor
Chapter 14 Preprocessor
Chapter 13 Strings
Chapter 13 Strings
Chapter 13 Strings
Chapter 12. Pointers and Arrays, Chapter 13 Strings
Exercises from Chapter 11,12 of King
- Given the following declarations
int i; int *p,*q;
Which of the following assignments are legal
p=i; *p=&i; &p=q; p=&q; p=*&q; p=q; p=*q; *p=q; *p=*q;
- Write the following function
void find_two_largest(int a[], int n, int *largest, int *second_largest);
- What will be the contents of array
aafter the following code is executed?
#define N 10 int a[N] = {1,2,3,4,5,6,7,8,9,10}; int *p=a,*q=a+N-1; while(p<q){ int temp=*p; *p++=*q; *q--=temp; }
Chapter 12. Pointers and Arrays
Chapter 11, Chapter 12. pointers
Chapter 10, Organization, Chapter 11
Chapter 10, Organization
Chapter 9, functions
Chapter 9, functions
Chapter 8, Arrays
Chapter 7, Type conversions
Chapter 7, int, float, char, getchar, putchar
Chapter 7, int, float, char, getchar, putchar
loops, goto-like statements, comma operator. Chapter 6 in King
Logical Expresssions,
if, conditional expressions
Expresssions. Chapter 4,5 of King.
Expresssions. Chapter 4 of King.
Formatted I/O, Expresssions. Chapter 3,4 of King.
Formatted I/O, Chapter 3 of King.
Introduction to C, Chapter 2, 3 of King.
Introduction to C, Chapter 2 of King.
Introduction to C, chapters 1 and 2 of King.