How Does Increment Operators Work...??

This is a discussion on How Does Increment Operators Work...?? within the C Programming forums, part of the General Programming Boards category; if the given expression is itself in that form and asked to program on it then how to convert it ...

  1. #31
    C++ Witch laserlight's Avatar
    Join Date
    Oct 2003
    Location
    Singapore
    Posts
    21,660
    if the given expression is itself in that form and asked to program on it then how to convert it
    You should ask the person who gave you that expression what it means.
    C + C++ Compiler: MinGW port of GCC
    Version Control System: Bazaar

    Look up a C++ Reference and learn How To Ask Questions The Smart Way

  2. #32
    Registered User
    Join Date
    Feb 2008
    Location
    PUNE
    Posts
    23
    he himself is blank so posted in da forum

  3. #33
    C++ Witch laserlight's Avatar
    Join Date
    Oct 2003
    Location
    Singapore
    Posts
    21,660
    he himself is blank so posted in da forum
    In that case the expression has no meaning, or has an arbitrary meaning (i.e., any meaning that you, or the compiler, assign to it).
    C + C++ Compiler: MinGW port of GCC
    Version Control System: Bazaar

    Look up a C++ Reference and learn How To Ask Questions The Smart Way

  4. #34
    Registered User
    Join Date
    Feb 2008
    Location
    PUNE
    Posts
    23
    actually i m working on linux

  5. #35
    C++ Witch laserlight's Avatar
    Join Date
    Oct 2003
    Location
    Singapore
    Posts
    21,660
    That makes no difference concerning the undefined behaviour.
    C + C++ Compiler: MinGW port of GCC
    Version Control System: Bazaar

    Look up a C++ Reference and learn How To Ask Questions The Smart Way

  6. #36
    Registered User
    Join Date
    Feb 2008
    Location
    PUNE
    Posts
    23
    yO i know tht....!!

  7. #37
    Registered User
    Join Date
    Dec 2008
    Posts
    1

    Smile Solution

    Quote Originally Posted by ajayd View Post
    please tell me for this expresion :
    a = (b++) + (- - b) + (b - -) + b
    here b = 4
    tell me manually ans : i am getting 15
    by applying your logic i am gettin 17
    plz check.....!!
    hey first evaluate pre increment or pre decrement in any expression then solve the expression without bothering post increment or post decrement
    here for b = 4
    a = b++ +(--b) + (b--)+b;
    a= b++ +3 +(b--)+b;
    a= 3+3+3+3;
    a=12;

  8. #38
    C++ Witch laserlight's Avatar
    Join Date
    Oct 2003
    Location
    Singapore
    Posts
    21,660
    Quote Originally Posted by Amito
    hey first evaluate pre increment or pre decrement in any expression then solve the expression without bothering post increment or post decrement
    Read the thread, friend. Your advice is useless due to undefined behaviour.
    C + C++ Compiler: MinGW port of GCC
    Version Control System: Bazaar

    Look up a C++ Reference and learn How To Ask Questions The Smart Way

Page 3 of 3 FirstFirst 123
Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Why don't the tutorials on this site work on my computer?
    By jsrig88 in forum C++ Programming
    Replies: 3
    Last Post: 05-15-2006, 10:39 PM
  2. Problems in getting OpenGL to work
    By zonf in forum C Programming
    Replies: 5
    Last Post: 02-13-2006, 03:48 AM
  3. Why won't my OpenGL work?
    By Raigne in forum C++ Programming
    Replies: 7
    Last Post: 11-26-2005, 10:53 AM
  4. Developers Wanted
    By Quasicom in forum Projects and Job Recruitment
    Replies: 2
    Last Post: 08-24-2005, 12:46 AM
  5. Overloading Operators
    By Strahan in forum C++ Programming
    Replies: 4
    Last Post: 09-07-2001, 11:39 AM

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