Thread: Begining Programmer: Need help with understanding functions

  1. #1
    Registered User
    Join Date
    Sep 2011
    Posts
    2

    Begining Programmer: Need help with understanding functions

    Anyone have any suggestions on a good online tutorial or video that explains functions. I am taking an online course in C programing and the chapter of functions confused me. I understand that functions are very important to programming. I know there are a ton of resources out there so I am asking for anyones input on what some of the better ones are. Thank you all in advance.

  2. #2
    Registered User
    Join Date
    Nov 2010
    Location
    Long Beach, CA
    Posts
    5,909
    You can start here: Functions in C - Cprogramming.com.

    c function tutorial - Google Search turned up dozens or hundreds more. At a quick glance, the first 5 or so links look decent for intro level stuff.

  3. #3
    Registered User
    Join Date
    Sep 2011
    Posts
    2

    Thanks.

    Thank you I will try it out.

  4. #4
    ATH0 quzah's Avatar
    Join Date
    Oct 2001
    Posts
    14,826
    A function is a tool, given a name, that executes its section of code. Functions need a return type, a name, an argument list, and the body (the lines that do the actual task):
    Code:
    returntype functionname( arguments )
    {
        /* function body */
    }
    Functions are used (called) by using their name with their arguments:
    Code:
    foo();
    Here the function foo is used, with no arguments. Its return value is being ignored, possibly because it doesn't return anything:
    Code:
    void foo( void )
    {
        printf( "hello world\n" );
    }

    Quzah.
    Hope is the first step on the road to disappointment.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Help understanding functions
    By nafix in forum C Programming
    Replies: 3
    Last Post: 10-13-2007, 07:18 PM
  2. Understanding functions
    By kryonik in forum C Programming
    Replies: 13
    Last Post: 08-31-2005, 05:04 PM
  3. understanding recursive functions
    By houler in forum C Programming
    Replies: 7
    Last Post: 12-09-2004, 12:56 PM
  4. FUNCTIONS....i need a better understanding
    By math in forum C++ Programming
    Replies: 4
    Last Post: 12-09-2001, 01:25 PM
  5. understanding functions
    By desperate in forum C Programming
    Replies: 8
    Last Post: 09-09-2001, 10:57 PM