Here's your original code with slight amendments to make it run. It'll only do commands that don't have parameters, you'll need to parse the input before you can do that.
Code:
#include <sys/types.h>
#include <sys/wait.h>
#include <unistd.h>
#include <stdio.h>
#include <errno.h>
#define PROMPT "fire:"
/* */
int main(void)
{
pid_t childpid;
int status;
char *v[5]; // the problem is to do with this array ive tried
char buffer[1024];
printf("%s", PROMPT); // char * but that makes it worse.
while (fgets(buffer, 256, stdin) != NULL)
{
if (buffer[0] == '\n') continue;
buffer[strlen(buffer)-1] = '\0';
v[0] = buffer;
v[1] = NULL;
if ((childpid = fork()) == -1)
{
perror("fork failed\n");
exit(1);
}
else if (childpid == 0)
{ /*child code*/
if (execvp(buffer, v) < 0)
{
perror("the exec of command failed");
printf ("buffer >%s<\n", buffer);
exit(1);
}
}
else /*parent code*/
while (childpid != wait(&status))
if ((childpid == -1) && (errno != EINTR)) break;
}
return (0);
}