New to user defined functions

This is a discussion on New to user defined functions within the C Programming forums, part of the General Programming Boards category; Can I put if statements in a user defined function? (You just know more questions about this assignment will be ...

  1. #1
    Registered User
    Join Date
    May 2004
    Posts
    68

    New to user defined functions

    Can I put if statements in a user defined function?
    (You just know more questions about this assignment will be coming...hehe)

    Thanks,
    Extro

  2. #2
    aoeuhtns
    Join Date
    Jul 2005
    Posts
    581
    Have you tried putting if statements in a user defined function?

  3. #3
    Registered User
    Join Date
    May 2004
    Posts
    68
    Yup, didnt work, just wondered if I can out an if statement in a user-defined function
    Thanks,
    Extro
    Last edited by Extropian; 08-15-2005 at 09:39 PM.

  4. #4
    Epo
    Epo is offline
    Registered User
    Join Date
    Jun 2003
    Posts
    361
    Code:
    int MyFunc(int Blah)
    {
    
    if (Blah == 0 ) return 0;
    
    return 1;
    
    }
    You can put if statements in user-defined functions.
    Pentium 4 - 2.0GHz, 512MB RAM
    NVIDIA GeForce4 MX 440
    WinXP
    Visual Studio .Net 2003
    DX9 October 2004 Update (R.I.P. VC++ 6.0 Compatability)

  5. #5
    Registered User
    Join Date
    May 2004
    Posts
    68
    Thank you

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. user defined header files
    By sidu in forum C++ Programming
    Replies: 1
    Last Post: 07-11-2008, 06:40 AM
  2. Message class ** Need help befor 12am tonight**
    By TransformedBG in forum C++ Programming
    Replies: 1
    Last Post: 11-29-2006, 10:03 PM
  3. Instant messenger app help
    By AusTex in forum C Programming
    Replies: 2
    Last Post: 05-01-2005, 12:41 AM
  4. Piecewise defined discontinuous functions in Mathematica
    By SourceCode in forum A Brief History of Cprogramming.com
    Replies: 6
    Last Post: 03-16-2005, 12:24 PM
  5. functions defined as a string
    By river-wind in forum C Programming
    Replies: 2
    Last Post: 11-21-2001, 09:36 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21