Q:

useing exec with parameters c

I made a program that gets a path for directory compiles the files in that directory's folders and executes them.
Now I tried using execl but I don't really know what the name of the executed files will be before I run the program.
Because the name of the file is the name of the folder it is in.
(for example I have .../omer/omer.c and I compile it to omer)
now when I execute I want to do something like that for it to work properly:
execl("./omer","./omer",NULL);

the way I was trying to do it is (I have the filename):
execl("./%s",fileName,"./%s",fileName);

but that doesn't do anything. Now the problem is that I can't use strcat() so I'm trying to avoid creating a function to create a string that has the "./" at the beginning ..
Is there any way to do what I tried without using something like strcat() or there's no way to avoid it
(basically I want to insert custom string to the execl)?
Thanks for helping!
edit : 
adding more of the code as requested : 
cFilePath = 
readStudentcFilePath(confContent[0],studentName,strLeng(confContent[0]));
pid = fork();
if(pid<0)
{
  fprintf(stderr, "Forking Error!\n");
  exit(FORK_ERR);
}
if(pid == 0)
{
  execl("/usr/bin/gcc","gcc",cFilePath,"-o",studentName,NULL);
  fprintf(stderr, "Failed to Execute file 'gcc' \n");
  exit(EXEC_ERR);
}
pid = fork();
if(pid<0)
{
  fprintf(stderr, "Forking Error!\n");
  exit(FORK_ERR);
}
if(pid == 0)
{
  studentOutFd = open("test_output.txt",O_WRONLY|O_TRUNC|O_CREAT);
  if(studentOutFd < 0 )
  {
    fprintf(stderr, "Error Opening File 'test_output.txt'\n");
    exit(FILE_OPEN_ERR);
  }
  dup2(STDIN_FILENO,inFd);
  dup2(STDOUT_FILENO,studentOutFd);
  execl("./%s",studentName,"./%s",studentName,NULL);
  fprintf(stderr, "Error Executing File %s\n", studentName);
  exit(EXEC_ERR);
}

A:

There is no need to prepend "./" to the name of the file if you are using execl (or any exec variant which doesn't have a p in its name). All of these versions of exec interpret their first argument as a pathname in the usual way; that is, as an absolute path if it starts with a / and as path relative to the current working directory otherwise. 
The exec variants which do have a p in their name (execlp, execvp, etc.) interpret their first argument differently if it does not contain a /. In this case, the pathname is searched for in the directories listed in the PATH environment variable (or a library-specific default, usually /usr:/usr/bin). Since . is not generally included in PATH, the filename will not be searched for in the current working directory.
Since the shell you use duplicates the functioning of execlp, you cannot run executables in the current working directory by just specifying their filename. You must write ./omer instead of omer. (Unless you add . to your PATH, of course. This is not recommended for security reasons.) Since ./omer includes a slash, it does not incur the PATH search.
But that doesn't apply to execl, so it is not necessary to include a / in order to force the use as a relative path.
If you did feel the need to specify a particular directory (such as /usr/share/lib/myapp), then you would need to concatenate a filepath. In that case, if you cannot use strcat (or don't want to use it), then you would have to write your own concatenation function. The %s expansion is not a language syntax. It's part of the printf and related library functions. (One of those related functions is snprintf, which is usually a safer and more convenient way of creating a string at runtime than repeated calls to strcat. However, if strcat is not available to you, it seems unlikely that snprintf is.)

