Forum     

Go Back   Digit Technology Discussion Forum > Software > Programming
Register FAQ Calendar Mark Forums Read

Programming The destination for developers - C, C++, Java, Python and the lot


Closed Thread
 
LinkBack Thread Tools Display Modes
Old 22-01-2010, 03:45 PM   #1 (permalink)
XLr8
 
arpanmukherjee1's Avatar
 
Join Date: Sep 2008
Posts: 637
Default c problem


hello

i want to know how the Turbo cpp (yes, the dinosaur one) and g++ give different output:
Code:
a=10
++a + ++a = 24 (g++)  & 23 (TC)
a++ + a++ = 20
++a - a++ = 0 (g++) & -1(TC)
please explain pre and post increment and decrement in this prgs.

also please tell how to obtain output of such prgs

one more thing -> if in expression pre and post increment occure together what is the precedence order??
__________________
Quote:
There are more things in heaven and earth, Horatio,
Than are dreamt of in your philosophy.
arpanmukherjee1 is offline  
Advertisements. Register and be a member of the community to get rid of them.
Advertisement

Old 27-01-2010, 03:17 PM   #2 (permalink)
XLr8
 
arpanmukherjee1's Avatar
 
Join Date: Sep 2008
Posts: 637
Default Re: c problem

\help!!!

tell me something!!!
__________________
Quote:
There are more things in heaven and earth, Horatio,
Than are dreamt of in your philosophy.
arpanmukherjee1 is offline  
Old 28-01-2010, 01:13 AM   #3 (permalink)
Apprentice
 
Apple Juice's Avatar
 
Join Date: Oct 2008
Posts: 61
Default Re: c problem

u sud not worry abt dat output. from a compiler to compiler the output get different due 2 de implementation. dat is why TC and gcc giv diff o/p.

check dis out, i got it from some1
http://tinyurl.com/yexbgmy

u sud knoe tc is for nuubs i dont wants 2 hurts u but dat is de way
Apple Juice is offline  
Old 30-01-2010, 11:35 AM   #4 (permalink)
XLr8
 
arpanmukherjee1's Avatar
 
Join Date: Sep 2008
Posts: 637
Default Re: c problem

Quote:
Originally Posted by Apple Juice View Post
u sud not worry abt dat output. from a compiler to compiler the output get different due 2 de implementation. dat is why TC and gcc giv diff o/p.

check dis out, i got it from some1
http://tinyurl.com/yexbgmy

u sud knoe tc is for nuubs i dont wants 2 hurts u but dat is de way
yep,i want 2 find how the compiler generates it???
__________________
Quote:
There are more things in heaven and earth, Horatio,
Than are dreamt of in your philosophy.
arpanmukherjee1 is offline  
Old 31-01-2010, 12:13 PM   #5 (permalink)
Apprentice
 
Apple Juice's Avatar
 
Join Date: Oct 2008
Posts: 61
Default Re: c problem

Quote:
Originally Posted by arpanmukherjee1 View Post
yep,i want 2 find how the compiler generates it???
uz gcc there you cn pass commandd:
Code:
gcc -S filename.c
you cn alsoo see the output in the filename.s file. it shows assembler o/p wcih teh compiler generates and then links

i dnt knw howw tc generates the code bt itz 4 nuuub neway


Apple Juice is offline  
Old 07-02-2010, 06:33 PM   #6 (permalink)
XLr8
 
arpanmukherjee1's Avatar
 
Join Date: Sep 2008
Posts: 637
Default Re: c problem

^thnks

BTW i think GDB might also help
__________________
Quote:
There are more things in heaven and earth, Horatio,
Than are dreamt of in your philosophy.
arpanmukherjee1 is offline  
Closed Thread

Bookmarks

Thread Tools
Display Modes

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
Problem with Pinnacle PCTV-Stereo puttu Hardware Q&A 4 15-06-2007 05:40 PM
hdd weird problem... i bet nobody has this problem vish786 Hardware Q&A 16 11-06-2007 08:21 PM
BIG BIG hardware problem... Please help... Very Urgent... go4saket QnA (read only) 21 13-01-2006 12:00 AM
Problem With My Monitor and UPS navino87 Hardware Q&A 7 08-01-2006 11:40 AM

 
Latest Threads
- by Charan
- by Charan
- by clmlbx

Advertisement




All times are GMT +5.5. The time now is 03:13 AM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2012, vBulletin Solutions, Inc.

Search Engine Optimization by vBSEO 3.3.2