I want to delete the cell which has “sth” in:
char* a[200];
how should I do it? I tried this but it does not work!
for(i=0;i<100;ti++)
{
if(strcmp(a[i],"sth")!=0)
temp[i]=a[i];
}
a=temp //not sure here
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
something like
i didnt free the memory here, since i dont know where the strings came from. If the strings were allocated with malloc they should be freed (if not used elsewhere)