error: result of comparison against a string literal is unspecified (use strncmp instead) and Check50 showing error on credit problem

error: result of comparison against a string literal is unspecified (use strncmp instead) and Check50 showing error on credit problem

为避免问多个问题,请参阅 stackoverflow 的 cs50 部分中的 details and code here
提前致谢。

错误信息很清楚。在 C 中,您 不能 将字符串与 == 相等运算符进行比较。所以而不是

if(... ||(brand == "VISA")

使用:

if(... ||strcmp(brand, "VISA")==0