C++ Error 个人笔记(live)

1.error: invalid conversion from 'char' to 'char*' [-fpermissive]

  • 原因:
    把一个字符型的变量赋值给了一个字符型的指针
    我的原因:
    char npemail[] 写成了char npemail,所以npemail被当做字char型传入person(char,char,char*, char* ,int)

2.error: void value not ignored as it ought to be

  • 原因:
    一个函数的返回值为void,但是你又把这个函数的返回值赋值给了一个具体类型的变量
    我的原因:
    本来myfirst指针应该指向它myfirst ->却写成了等于myfirst =
posted @ 2020-06-02 19:39  HUGBOY  阅读(417)  评论(0编辑  收藏  举报