int main(void) { v7_val_t result; struct v7 *v7 = v7_create(); v7_exec(v7, "var sum = function(a, b) { return a + b; };", &result); call_sum(v7); v7_destroy(v7); return 0; }
int main(){ char fir[MAX],sec[MAX],res[MAX]; while(scanf("%s%s",&fir,&sec)==2){ call_sum(fir,sec,res); int len=strlen(res); for(int i=0;i<len;i++) printf("%c",res[i]); printf("\n"); } return 0; }
int main(void) { enum v7_err rcode = V7_OK; v7_val_t result; struct v7 *v7 = v7_create(); rcode = v7_exec(v7, "var sum = function(a, b) { return a + b; };", &result); if (rcode != V7_OK) { fprintf(stderr, "exec error: %d\n", (int)rcode); goto clean; } call_sum(v7); clean: v7_destroy(v7); return (int)rcode; }