To make a program go really into background, i.e. become a "daemon", you can just call deamon() (see "man 5 daemon")
Code:
#include <stdio.h>
#include <unistd.h>
int main()
{
if(daemon(0,0) < 0) {
perror("");
return 1;
}
/* ... */
return 0;
}
Note that this makes it the program go into background to never come back. It completely detaches from the terminal, and looses stdin, stdout and stderr. It's not what the shell does when ending a command with "&". (or was it that what you were looking for?)