gpt4 book ai didi

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

转载 作者:行者123 更新时间:2023-11-30 21:04:47 25 4
gpt4 key购买 nike

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

最佳答案

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

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

用途:

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

关于c - 错误: result of comparison against a string literal is unspecified (use strncmp instead) and Check50 showing error on credit problem,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59509512/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com