LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 07-06-2004, 02:24 PM   #1
Majjj
LQ Newbie
 
Registered: Sep 2003
Location: Hyderabad
Distribution: Fedora Core 2
Posts: 10

Rep: Reputation: 0
operator precedence in C


hi all...

can anyone tell me how does the compiler evalutes this expression..
initial value of i = 0

int j = ++i - ++i * ++i + ++i * i++ ;

what is the value of j and i finally...
is this anyway compiler dependent. Please suggest some site where I can get some similar examples.

awaiting reply
majjj
 
Old 07-06-2004, 05:02 PM   #2
jim mcnamara
Member
 
Registered: May 2002
Posts: 964

Rep: Reputation: 36
try:
http://www.phim.unibe.ch/comp_doc/c_...recedence.html
 
Old 07-07-2004, 11:48 AM   #3
Berhanie
Senior Member
 
Registered: Dec 2003
Location: phnom penh
Distribution: Fedora
Posts: 1,625

Rep: Reputation: 165Reputation: 165
I believe that's a compiler error. You cannot alter the value of variable ("i", in this case) more than once between sequence points
 
  


Reply



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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Simple Operator Precedence C++ Problem rovitotv Programming 9 03-21-2005 10:02 PM
C++ operator += uman Programming 1 02-20-2005 04:37 PM
Why does /etc/profile take precedence over my .bashrc file? MDesigner Linux - Newbie 8 06-29-2004 08:55 PM
c++ [] operator overloading exodist Programming 12 04-17-2004 03:06 PM
~ operator linuxanswer Programming 7 04-08-2004 04:56 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 02:19 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration