c.ihypress.ca: examples of C programs
Home > 06. Functions II (Pointers)
  1. A function with two results
    This program shows a function that generates two results. One result is returned, the other accessed from the main via an address.
  2. The bigger2 function: using pointer arguments
    This function returns nothing but will change the value of the variable in the calling function's memory area.
  3. Prime numbers (by reference)
    A function that determines if a number is prime or not. The function returs 1 if prime, 0 if not. In addition, the function will "return" the value of one of the divisors.
  4. The double_triple function: two results by reference
    A function that takes in an integer number and "returns" both twice the number and three times the number.
  5. The separate function: multiple results by reference
    A function that takes a real number and splits it into three parts: a sign (character), a whole part (integer) and a fraction (double).
  6. The readex function: two results from a scanf
    A simple addition reader/parser for 2 doubles.
  7. The multiply function: using recursion
    A function that multiplies two integers without using the multiplication (*) operator.
Ihypress.ca is online since February 17, 2005.
 
[ Window Treatments | "Alias - Die Agentin" A Dark Turn | buy mp3 music online ]