warning: comparison between pointer and integer in C

前端 未结 5 1277
栀梦
栀梦 2021-01-23 16:39

I get a warning

warning: comparison between pointer and integer

on the line containing if from the next piece of code:

         


        
5条回答
  •  孤独总比滥情好
    2021-01-23 17:17

    In the return types section of the following link, getcwd returns null on failure. Thus, instead of checking for != (char *)NULL just check for != NULL

    http://linux.die.net/man/3/getcwd

提交回复
热议问题