x is a C string, and the first argument to fopen is also a C string, so it is just a matter of using x as an argument. Of course, this does not mean that x is free of problems. You may want to check...