Exforsys

Online Training

auto-increment!! help!

This is a discussion on auto-increment!! help! within the C and C++ forums, part of the Programming Talk category; int c=6; b=c++ - --c*c++; printf("%d%d",c++ - --c*c++,b); there is a difference ...


Go Back   Exforsys > Programming Talk > C and C++

Register FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 12-29-2006, 03:42 AM
Junior Member
 
Join Date: Nov 2006
Posts: 3
chaisen2006 is on a distinguished road
Unhappy auto-increment!! help!

int c=6;
b=c++ - --c*c++;
printf("%d%d",c++ - --c*c++,b);
there is a difference in th output how it that?? can u help plzz!!
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 02-05-2007, 07:45 PM
Member
 
Join Date: May 2006
Posts: 38
zsk_00 is on a distinguished road
int c=6;
b=c++ - --c*c++;
b= 6 - (7-1) * 6; // now c=7

in printf function, you are starting with c=7. When you calculated b, you started with c=6
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads

Thread Thread Starter Forum Replies Last Post
Auto Commit Ralph Oracle Database 6 01-14-2007 02:34 PM
Query and List, PhP Main Page Auto Listing of User Actio CarryD PHP 0 09-02-2006 05:51 PM
Auto CADD Engineer (Position At Our Delhi/Noida office) techguru Freshers Jobs 0 05-17-2005 07:59 AM
Auto CAD Engineer(Fresher 0-6 Months Exp.) techguru Freshers Jobs 0 05-16-2005 08:40 AM
Auto Desk India recruits Freshers from top Institutes techguru Freshers Jobs 0 05-02-2005 09:27 AM


All times are GMT -4. The time now is 12:31 AM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.1.0
Copyright 2004 - 2007 Exforsys Inc. All rights reserved.