aki wrote:
Hello ,
i want to use system commnad in my code to delete files in specified
manner.
Your subject header and this sentence are both incorrect. system() is a
C function, not a command, and certainly not a "Unix command".
but this way i am not able to delete files.
Use the C remove function. Surely this is in any elementary C textbook.
#include <stdio.h>
int remove(const char *filename); /* returns 0 for success, nonzero
otherwise */
If you don't have a standard C compiler, you could try the unix system
function unlink(). If you do that, remember that it is non-standard,
making your program not portable and making any enquiries about it
off-topic here.
You also need to find out what language you are using.
Lines like
string omcid;
contain an undefined identifier 'string' in C, unless you have defined
it somewhere. If you have, show it to us; don't make us guess what it
means,
and things like
cout<<"omcid"<<omcid<<endl; // here i printed the value it
iscoming correct
have a number of problems. 'cout' and 'endl' are undefined in C, left
shifting by a string constant has no meaning, and the '//' style comment
has, as you can see, resulted in a broken line with the nonsensical line
of code 'incoming correct' as a result.
It appears that you have no idea what language you are using, or what
functionality is available in it.