you keep mentioning script... do you mean script or c? truncate is a C function, not a script command.
but you'd probably want
char *file = "var/tmp/junk";
truncate ( file, 0);
but erm... you seem to have just blindly copied it from the manpage... what you have there is a header reference, nothing usable in the slightest... maybe you should be reading a few more manuals?
and this kind of thing should be in the programming forum.