This content has been marked as final. Show 4 replies
What part are you asking about? The macro or the way that you're using a char array variable oddly (and IIRC mistakenly)?
Are you aware that you're not actually evaluating the string?
Don't try to convert a C program line for line to a Java program. They are completely different. C is procedural, Java is Object Oriented. The two don't mesh. They are not one-to-one translatable. Figure out what the C program is meant to do, and reprogram it in Java. You can use parts of the C program as a template for some tricky areas, maybe, sometines, but you cannot just simply translate one to the other. It doesn't work that way. Technically you can, but expect the "new" Java version of the C program to have about half the efficiency, in that case, which pretty much negates the purpose of the rewrite.
I need simulate the macros behavior (#), in small words...take a code of calculate and write in a log one by one the execution and evaluate intructions and variables. Example.
this C program use a very long calculate formules, and is prioritary check the calcule and write al the steps, that C macros can do. That write all the steps and variable values used.
if(x==(beta*alfa / sin(y))) then bla bla bla...
write in log:
Si ( X == (BETA * ALFA / SIN(Y))))
X = 2.15; BETA=1; ALFA=0.1; Y=4;
i need a similar logs...not equal to C may be using objects, etc..
But in java i not know how i can write a operator ... In C++ i know
CClass::operator == (double value)
but in java??
Thats rigth, i only need simulate in java this log type, the log using macros allow me register all calcule with the variable values, is a scientific program :S, is prioritary register al calculate.
One idea may by generate a interpreter language how to Basic, and migrate this calculate routines to Basic, but is too large process to implement in my short develop time.
That is why i question to yours if any know a simply form to do that, similar to macros uses or have another idea