void fileNameProcess(char * inputName){
int size =strlen(inputName);
bool change=false;
char * name=inputName;
for(int i =0; i<size; i++){
char temp=* (name+i);
if(temp<0x10||temp>0x5b){
change=true;
}else if(0x19<temp<0x21){
change=true;
}else if(0x3a<temp<0x41){
change=true;
}
if(change){
//*(name+i)='_';
memset(name+i, '_', 1);
change=false;
}
}
}
it breaks when i try to set a character in a string (memeset), but i dont understand why it doesnt allow me to do that? why i can allow access to read it but couldnt modify it? can anyone explain it in memory aspect. i guess it is because the string is passed into the function. but as long as i know the memeory location, i could set it right?
thanks
char * filename= strdup("try1.mat");
writter.locate(filename);
in locate it assign filename to class memeber char* filepath