I'm told the following C code
#define ADD(a, b) a + b
// example function
void foo()
{
int i = ADD(1, 2); // add two ints
double d = //doubles
ADD(3.4, 5.6);
int sly = ADD(1, 2) * 3; // not what it appears to be
}
converts to this Java code
package demo;
public class DemoTranslation {
public static int add(int a, int b) {
return a + b;
}
public static double add(double a, double b) {
return a + b;
}
/**
* example function
*/
public static void foo() {
int i = add(1, 2); // add two ints
double d = /* doubles */ add(3.4, 5.6);
int sly = 1 + 2 * 3; // not what it appears to be
}
}
1+2*3 in java = 7. How does the C code produce that and not 9?