![]() |
|
![]() |
|
|
Thread Tools | Display Modes |
|
|
#11 |
|
Programming Guru
![]() Join Date: Jun 2005
Location: elemental plane
Posts: 1,429
Rep Power: 5
![]() |
You can do something like this though:
#define Max(x, y) (((x) > (y)) ? (x) : (y))
__________________
"Employ your time in improving yourself by other men's writings, so that you shall gain easily what others have labored hard for." -- Socrates |
|
|
|
|
|
#12 |
|
Professional Programmer
![]() Join Date: Sep 2005
Posts: 419
Rep Power: 4
![]() |
>Narue, what are you so pissed about anyway
I'm not pissed about anything. Though I was a bit annoyed that you kept ignoring the valid help by saying it didn't answer your question. This suggests that all you want is the answer and you couldn't care less about learning anything.
__________________
Even if the voices aren't real, they have some pretty good ideas. |
|
|
|
|
|
#13 |
|
Newbie
Join Date: Apr 2006
Posts: 16
Rep Power: 0
![]() |
Here's what happens when i try to avoid w and z:
> cat a.c #include <stdio.h>
#define SmartMax(x,y) (y>x) ? y : x
int main()
{
int x=8,y=6;
SmartMax(x,y)=100;
printf("%d\n",x);
return 0;
}> gcc -x c a.c a.c: In function `main': a.c:7: invalid lvalue in assignment |
|
|
|
|
|
#14 |
|
Resident Grouch
![]() ![]() ![]() ![]() ![]() ![]() Join Date: Jun 2005
Posts: 6,453
Rep Power: 10
![]() |
Maybe you could run down to Wal-Mart, buy some attention span, and re-read the thread.
__________________
Abstraction doesn't make it impossible to write bad code; it makes it possible to write superior code. Contributor's Corner: Grumpy on C++ Exceptions DaWei on Pointers |
|
|
|
|
|
#15 |
|
Professional Programmer
Join Date: May 2005
Location: Bad Nauheim, Germany
Posts: 436
Rep Power: 4
![]() |
does that come in a spray-can or a tube?
![]()
__________________
-Steven "Is this a piece of your brain?" - Basil Fawlty |
|
|
|
|
|
#16 | |
|
Troll
Join Date: Apr 2005
Location: Texas
Posts: 732
Rep Power: 4
![]() |
Quote:
__________________
MD5(sig) = bcef75433db02e9ad9bf81d6f7c5c270 |
|
|
|
|
|
|
#17 | |
|
Programming Guru
![]() Join Date: Jun 2005
Location: Adelaide, South Australia
Posts: 1,221
Rep Power: 5
![]() |
Quote:
|
|
|
|
|
|
|
#18 |
|
Newbie
Join Date: Apr 2006
Posts: 16
Rep Power: 0
![]() |
Maybe you should get out more.
So formally, should the code in my first post return "y 6" or "y 100"? |
|
|
|
|
|
#19 | |
|
Resident Grouch
![]() ![]() ![]() ![]() ![]() ![]() Join Date: Jun 2005
Posts: 6,453
Rep Power: 10
![]() |
Quote:
__________________
Abstraction doesn't make it impossible to write bad code; it makes it possible to write superior code. Contributor's Corner: Grumpy on C++ Exceptions DaWei on Pointers |
|
|
|
|
|
|
#20 |
|
Newbie
Join Date: Apr 2006
Posts: 16
Rep Power: 0
![]() |
Formally, should the code in my first post return "y 6" or "y 100"?
|
|
|
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|