by using strcmp i think it's not working
can anyone help?Code:strcmp(input,"\n");
by using strcmp i think it's not working
can anyone help?Code:strcmp(input,"\n");
With that amount of code - no.
If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
If at first you don't succeed, try writing your phone number on the exam paper.
Have you actually looked up strcmp and see how it is used and what the function prototype looks like or did you just ASSUME you know how to use it.
1. Get rid of gets(). Never ever ever use it again. Replace it with fgets() and use that instead.
2. Get rid of void main and replace it with int main(void) and return 0 at the end of the function.
3. Get rid of conio.h and other antiquated DOS crap headers.
4. Don't cast the return value of malloc, even if you always always always make sure that stdlib.h is included.
Life is like riding a bicycle. To keep your balance you must keep moving - Einstein
well assume input is a string and compare with "\n"
if my input is return(enter), is it gonna return 0?
Depends on what function you are using to get keyboard input. Some may strip off the "\n".
Tell you what Vince... post more than half a line of code for us to look at...
It's obvious you are trying to solve some kind of problem but you won't get much help with it unless we can actualy see it.
And, darn, wouldn't you know it... my mind reading ray gun is in the shop for adjustment.