#include "mathlink.h"
/* send the expression Integrate[1/x^2,x] to a link */
void f(MLINK lp)
{
if(! MLPutFunction(lp, "EvaluatePacket", 1))
{ /* unable to put the function to lp */ }
if(! MLPutFunction(lp, "ToExpression", 1))
{ /* unable to put the function to lp */ }
if(! MLPutString(lp, "Integrate[1/x^2, x]"))
{ /* unable to put the string to lp */ }
if(! MLEndPacket(lp))
{ /* unable to put the end of packet indicator to lp */ }
if(! MLFlush(lp))
{ /* unable to flush the buffered data in lp */ }
}