Alright so I am getting a weird problem with the following code
int toDB[2];
int fromDB[2];
char * param1;
char * param2;
err = pipe(toDB);
if(err==-1)
{
printf("Error on pipe creation: %d\n", errno);
exit(1);
}
sprintf(param1, "%d", toDB[0]);
err = pipe(fromDB);
if(err==-1)
{
printf("Error on pipe creation: %d\n", errno);
exit(1);
}
sprintf(param2, "%d", fromDB[1]);
The last line of code sprintf(param2, "%d", fromDB[1]);
is the line causing the problem, if it is commented out the code runs, if it is not commented out I get a core dump, can anyone see what i am doing wrong?
NOTE: This is not the full code.