hi,
I have a problem of concatenating 2 strings. 1 of the strings is defined in the code and the other one is asked from user. This small code must only concatenate these to strings but doesn't work...
here is my code:
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
struct deneme
{
char *filename;
} *dene;
int main ()
{
dene = malloc (sizeof(struct deneme));
dene->filename = (char*)malloc(200*sizeof(char));
char *path=(char*)malloc(sizeof(char)*250);
path = "/bin/";
printf("Enter a file name: ");
fgets(dene->filename,200,stdin);
printf("filename:%s",dene->filename);
strcat(path,dene->filename);
printf("concatenated: %s\n",path);
return 0;
}