|
|||||||
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
#1 |
|
Member (1 bit)
Join Date: Sep 2004
Posts: 1
|
Finding Sum without using + operator
Hi,
I want to do the following: int a = 10; int b = 2; int res = 0; char *op = "+"; // now, without using + operator in the next coming lines,can i get the sum // of a and b like in following way: res = a op b; or in any other manner using 'op' instead of '+'. Can we do this? |
|
|
|
|
|
#2 |
|
Professional gadfly
|
No, the compiler isn't going to like that.
Is this some kind of assignment where you have to find a sum without using +? |
|
|
|
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|