I'm trying to concatenate two strings to be used as a path for fopen(). I have the following code:
#include<stdio.h>
#include<stdlib.h>
#include<string.h>
#include<malloc.h>
void main() {
    char *inputchar = (char*)malloc(sizeof(char)), *absolutepath = (char*)malloc(sizeof(char));
    FILE *filepointer;
    gets(inputchar); //Name of the file that the user wants
    absolutepath = "D:\\Files\\";
    strcat(*inputchar, *absolutepath); //Error occurs here
    filepointer = fopen(*inputchar, "r"); //Do I need to use the deference operator?
    fclose(filepointer);
    free(inputchar);
    free(absolutepath);
}
Error occurs at strcat(). What happened there?
And is it correct that I have to use deference operator for inputchar at fopen()?
 
     
    