Hello all, first time poster and C newbie..
I'm trying to convert my simple script, to a C plugin...
And here is my lame attempt in C.Code:output = File("test.obj","wb"); output.writeData(test); output.close(); @data test 070 079 082 077 000 000 001 136 076 087 079 050 084 065 071 000 000 000 016 082 101 100 000 086 111 105 100 000 000 086 105 100 000 000 076 065 089 082 000 000 000 018 000 000 000 @end
The problem with this code, is it writes the 1byte decimal numbers literally, instead of as binary, despite the WB flag.Code:#include <stdio.h> #include <stdlib.h> void main() { FILE *myfile; myfile = fopen("test.obj","wb"); if(!myfile) { puts("Some kind of file error!"); exit(0); } fprintf(myfile,"070 079 082 077 000 000 001 136 076 087 079 050 084 065 071 000 000 000 016 082 101 100 000 086 111 105 100 000 000 086 105 100 000 000 076 065 089 082 000 000 000 018 000 000 000"); fclose(myfile); }
I'm guessing i might have to use sizeof or count bytes,
but i'm only guessing... (scripting is so much easier!)
Any and all help would be appreciated...... Especially a working example, as iv'e posted a similar question elsewhere a few weeks back, but all of the suggestions did not work as the script does.
I can't read music, but i can play music by ear...
Cheers,
Scott