c - error: comparison between a pointer and an integer -
I am trying to write a simple shell that can control redirection. However, I get "error: comparison between a pointer and an integer". I understand why I am getting the error, but I am unsure about fixing it. Args is declared as:
stable char * args [512]; This is the code where I'm getting the error:
if (args == '
If the error is in line (Args == '& lt;') and if (Args == '>')
Any suggestion welcomed
I think args is a pointer char (if it is), then you Comparing pointer with single character. You can do this:
if (args [0] == '& gt;') // then do something
Comments
Post a Comment