Hello I try to read a string from main and then parse it to a function and find its size but my code doesn't works can you help me?
//main
int size=10;
char *string= (char*) malloc (sizeof(char)*15);
scanf("%s",string);
findAllReplacements(NULL,10,string);
//at findAllReplacements
void findAllReplacements(nameInfoT* names,int size,char* expression){
int ssize=strlen(expression);
printf("%stringsize:%d\n",ssize);
The program crashes at strlen. What am I doing wrong? I give as input "astring"
The size argument has nothing to do with the size of the string;