Thread: Functions are Still Not Understood.

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Registered User errigour's Avatar
    Join Date
    Mar 2009
    Posts
    102

    Functions are Still Not Understood.

    I need help because I cant seem to understand how functions work with arguments
    and structures.

    I have this function in a program,
    void do_cast(struct char_data *ch, char *argument, int cmd, int subcmd)

    with a lot of code I could post for you if you want to help me change it.

    What I need help with is understanding how
    a) the function will return the structure
    b) how to return the structure when using do_cast
    c) how the function will return the char *argument
    d) how the function will return the int cmd
    e) and how the function will return the int subcmd

    Basically I need help understanding how a function returns its variables
    from the computer language inside its brackets and how to use the function
    and its variables in a c program.

    This isn't my homework, I really have a program that has that function. I also
    tried learning how to use functions from c programming.com without any
    luck so i'm hoping someone can explain functions to me so that I might understand
    how to use them proficiently or even well enough to make a useful program
    function. If someone would help me understand these how to's then i will
    understand functions. that is why i posted the question and also so that
    whoever reads my questions may understand the question I am asking. I
    repeat again I am not asking for homework help. I do not go to school.

    If anyone has some extra time on there hands I Would like to know how to make a
    useful command line argument for a telnet program. Maybe something cool that
    you have on your mind or have used or a liked that feature when using a telnet
    program or any program that accepts command line arguments.
    Last edited by errigour; 04-09-2009 at 04:32 AM.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Void Functions Help
    By bethanne41 in forum C++ Programming
    Replies: 1
    Last Post: 05-09-2005, 05:30 PM
  2. Functions and Classes - What did I do wrong?
    By redmage in forum C++ Programming
    Replies: 5
    Last Post: 04-11-2005, 11:50 AM
  3. calling functions within functions
    By edd1986 in forum C Programming
    Replies: 3
    Last Post: 03-29-2005, 03:35 AM
  4. Factory Functions HOWTO
    By GuardianDevil in forum Windows Programming
    Replies: 1
    Last Post: 05-01-2004, 01:41 PM
  5. Shell functions on Win XP
    By geek@02 in forum Windows Programming
    Replies: 6
    Last Post: 04-19-2004, 05:39 AM