I'm doing a job and I came in a part of removing the file that the user wants, but it reads and does not remove. to remove should i use extension (.txt)? if so how?
void removeCliente() {
char codigo [50]; int excl;
int *p;
char * file_name;
//FILE* verifica;
printf("entre com o código do cliente que deseja excluir:");
scanf("%s",&codigo);
file_name=codigo;
FILE *fo = fopen(file_name,"r");
if (fo == NULL){
printf("Ocorreu um erro!");
//return 0;
}
else{
fclose(file_name);
fflush(stdin);
remove(file_name);
printf("usuario %d removido com sucesso");
//sleep(10);
}
menugerente();
}