this code works like this
lets say we have a string word' = "abcdabc";
and we want to erase a word that is included in word'
if word = "abc" we want to make word' = " d ";
i ve done this so far
Code:
#include <stdio.h>
#include <string.h>
void str_return(char input[],char strsearch[]){
int i,z;
// printf("%s\n",input);
// printf("%s\n",strsearch);
//getchar();
for (i=0;i<14;i++){
if (&input[i] == strstr(input,strsearch) && strstr(input,strsearch)!=NULL){
for (z=i;z<i+strlen(strsearch);z++){
input[z] = ' ';
}
}
}
}
int main(void){
char x[] = "lolsopaasdlol";
int i=0,y=0,z;
printf("%d\n",sizeof(x)/sizeof(char));
str_return(x,"asd");
printf("%s\n",x);
// system("pause");
return 0;
}
here -> for (i=0;i<14;i++){
i want to put where 14 sizeof(input)/sizeof(char)
but the sizeof(input)/sizeof(char) inside the function is 4 while in main() function it's 14
why is that?
Thanks