warning: comparison between pointer and integer in C

前端 未结 5 1293
栀梦
栀梦 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 16:58

    Do you include unistd.h? If not, the error appears because your C compiler is assuming getcwd returns int.

    The fix? Include unistd.h

提交回复
热议问题