functions

This is a discussion on functions within the C Programming forums, part of the General Programming Boards category; is 2 square is 2**2 and wht does a%=b does it a have difference from a%b ( by the way ...

  1. #1
    Registered User
    Join Date
    Mar 2009
    Posts
    28

    functions

    is 2 square is 2**2
    and wht does a%=b does it a have difference from a%b ( by the way it means modulo, doesnt it???)
    and a+=b...
    what does this mean a?b

  2. #2
    C++まいる!Cをこわせ! Elysia's Avatar
    Join Date
    Oct 2007
    Posts
    22,785
    %= Do modulo and assign.
    += Do addition and assign.
    2 square is pow(2, 2) [function]
    a ? b You probably saw something like a ? b : c, which means if a is true, return b, otherwise c. It's an if shortcut.
    Quote Originally Posted by Adak View Post
    io.h certainly IS included in some modern compilers. It is no longer part of the standard for C, but it is nevertheless, included in the very latest Pelles C versions.
    Quote Originally Posted by Salem View Post
    You mean it's included as a crutch to help ancient programmers limp along without them having to relearn too much.

    Outside of your DOS world, your header file is meaningless.

  3. #3
    DESTINY BEN10's Avatar
    Join Date
    Jul 2008
    Location
    in front of my computer
    Posts
    804
    is 2 square is 2**2
    there is no operator as **.instead a power function is present in c.
    eg
    pow(m,n)//calculates m raised to the power n
    and wht does a%=b does it a have difference from a%b
    this means a=a%b where % is the modulo operator which gives the remainder of a/b;
    similarly a+=b means a=a+b;
    a?b doesn't do anything.it must be a?b:c where ?: is a ternary operator which means if a is true retun b else return c.

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, 02: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

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