warning: comparison between pointer and integer in C

前端 未结 5 1289
栀梦
栀梦 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:51

    The prototype of getcwd is

    char *getcwd(char *buf, size_t size);
    

    Make sure you include otherwise the return type would default to int.

    Here, even Ideone gives its Current Working Directory

提交回复
热议问题