c.ihypress.ca: examples of C programs
Home > 07. 1D Arrays
  1. Initializing an array
    A program that fills an array of 100 doubles with zeroes.
  2. Initializing an array using a function
    A function that takes a value and an array and fills the array with that value.
  3. Computing statistics
    A program that computes the mean and standard deviation of the contents of an array of doubles.
  4. Filling an array from a file
    A program that fills and array of 10 integers from a file.
  5. A pointer for an array parameter
    A program that fills an array with a value submitted by the user.
  6. Filling partially an array
    A program that partially fills an array from a file until the end of file (EOF). The program uses a function that fills the array and returns the actual number of data read.
  7. Adding two arrays
    A function that adds the corresponding values from two arrays of the same size and puts the results in a third array.
  8. Searching a 1-D array
    A function that look for a value in an array and returns the cell number where it was found or -1 if not found.
  9. Dynamic allocation of a 1-D array
    A program that allocates a dynamic array of a size chosen by user input.
Ihypress.ca is online since February 17, 2005.
[ Would like to save Skype conversation? Skype Recorder for MacOS - get it now. | | ]