Code:
#include <stdio.h>
#include <string.h>

#define firstnames 15
#define lastnames 15
#define names 30

int main ()
{
 char firstname[firstnames];
 char lastname[lastnames];
 char name[names];
 char *string;
 int x;
 char y = '!';

 string = name;

 printf("What yo first name be son?\n");
 gets(firstname);
 if(gets == 0x00)
 {
  printf("you know yo name ain't dat long.\n");
  exit();
 }
 strcpy(name, firstname);
 printf("and yo last name?\n");
 gets(lastname);
 if(gets == 0x00)
 {
  printf("you know yo name ain't dat long.\n");
  exit();
 }
 strcpy(name, lastname);
 printf("hmm. so this be yo name then?");
 while(y != '\0')
 {
  printf("%C", string[x]);
 }
 getch();
}
i cant seem to get this code to work. it compiles and all, but whenever i put in my last name and press enter, it just says 'hmm. so this be yo name then?' and has nothing there. can anyone tell me how to get it to display the full name?

and also, is there another alternative(other than void) to pause my program at the end so i dont have to go to the run.exe thing everytime?