What is the type of
InData
?
Assuming it is
char *
Your function should be something like (not the best solution but with minimum changes in your code):
#include <string.h>
#include <stdio.h>
#include <stdlib.h>
static char* get_input()
{
char input[1024];
printf("Enter input data of size less than 1024 bytes and write end to end the data: ");
fgets(input, 1024, stdin);
char * InData = (char *)malloc(strlen(input) + 1);
strncpy_s(InData, 1024, input, 1024);
return InData;
}