![]() |
|
#1
|
|||
|
|||
equivalent expressionsI have the following code:
int a = 1, b = 2, c = 3; a += b += c += 7; Is the following code the equivalent expression fully parenthesized: (a = (a + (b)) = (b + (c)) = (c + 7)) If not please help because I am at a loss. I know that the code simplifies to the following: a = a + b b = b + c c = c + 7 Please help this is a self taught distance course and I am struggling hard since it is my first programming language. Thanks |
|||
|
#2
|
||||
|
||||
|
Quote:
CPP / C++ / C Code:
CPP / C++ / C Code:
Matthew (Edited) |
|
#3
|
|||
|
|||
|
Quote:
Here's a suggestion: Put both expressions in a program and print out the results. Once you see the "right answer" (that is: are the results the same or different?) work your way back to see if you can explain it. Maybe break the expressions into multiple statements. That could give some clues. If you develop a methodology for learning I think you can learn a lot more (and also answer your own questions when there's no one else around). My methodology for learning new or puzzling aspects of a programming language is: Plug it into a program. Try it. (What's the worst that could happen? What's the best that could happen?) If you get results that you don't understand, ask specific questions. Regards, Dave |
Recent GIDBlog
Vista ?Widgets? on Windows XP by LocalTech
| Thread Tools | Search this Thread |
| Rate This Thread | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| equivalent of clrscr() on unix/linux?? | nkhambal | C Programming Language | 1 | 03-Sep-2004 16:53 |
| help with gnu regular expressions | henrywidd | C Programming Language | 1 | 19-May-2004 05:45 |
| regular expressions | erniegerdie | MySQL / PHP Forum | 6 | 08-Mar-2004 05:46 |
| Regular Expressions question. | JdS | MySQL / PHP Forum | 3 | 04-Nov-2002 14:04 |
Network Sites: GIDNetwork · GIDWebHosts · GIDSearch · Learning Journal by J de Silva, The