I was trying to use strncpy and then strcpy and vice versa, but I kept receiving a segmentation fault during runtime. I thought this was because of an logical error in the functions, but I switched their places and only the first one would execute. 
#include <stdio.h>
#include <string.h>
int main(void)
{
    char c = ' ', sentence[50], *pointer_to_string;
    pointer_to_string = &sentence[0];
    int index = 0;
    printf("Please enter a sentence:");
    while ((c = getchar()) != '\n')
    {
        sentence[index] = c;
        index++;
    }
    sentence[index] = '\0';
    char *string_copy1, *string_copy2;
    strncpy(string_copy1, pointer_to_string, 5);
    printf("strncpy(string_copy1, pointer_to_string, 5):\n");
    printf("%s\n", string_copy1);
    strcpy(string_copy2, pointer_to_string);
    printf("strcpy(string_copy2, pointer_to_string):\n");
    printf("%s\n", string_copy2);
}
 
    