Originally Posted by
Chri5ty
I need immediatly a C++ function that exports a '.mp3' or '.wav' file from a variable.
The variable is int song[position], where position is a long variable. I promise that whoever gives me the function, will recieve the software that I am currently working(for writing music).
untested!
Code:
#include <stdio.h>
int main(void)
{
FILE *fp;
int song[10] = {0,1,2,3,4,5,6,7,8,9};
int position = 4;
char file[128];
sprintf(file, "%d.wav", song[position]);
fp = fopen(file, "w");
if (fp)
{
fputs("I´m only happy when it rains\n"
"I´m only happy when it´s complicated\n"
"And though I know you can´t appreciate it\n"
"I´m only happy when it rains\n", fp);
fclose(fp);
}
return 0;
}