I don't know about the system() call but one thing is clear that every process maintains it own separate path variables.
so try exporting the variable and making it global by using the
export command.
May be you can use,
Code:
system("export PATH");
But still it may be unsure because
system() itself forks a new process to execute the given command. so a code below might work incase "export" works.
Code:
if(fork()==0)
{
//Set the PATH variable
//Use exec to execute the export command.
}