| Author |
Comment/Response |
PatR1
|
04/24/07 01:35am
Please help, I am interfacing my c++ program with mathlink.
And I cannot figure out how to assign an external variable to a symbol.
Int p, x=23;
MLPutFunction(link, "EvaluatePacket", 1);
MLPutFunction(link, "ToString", 1); /
MLPutFunction(link, "ToExpression", 1);
MLPutFunction(link, "Plus",2);
MLPutInteger(link,x)
MLPutInteger(link,p)
The above example works, it adds 2 integer variables together.
The problem is I don’t know how to assign a integer variable to a symbol.
This is what I want to do:
MLPutFunction(link, "EvaluatePacket", 1);
MLPutFunction(link, "ToString", 1); /
MLPutFunction(link, "ToExpression", 1);
MLPutString(link,”x+p”);
MLPutSymbol(link,X) // how to assign variable x to symbol X????
MLPutSymbol(link,p)
Thanks so much
Pat
URL: , |
|