相关疑难解决方法(0)

赋值使得整数指针不需要强制转换

来自Java背景我正在学习C,但我发现那些模糊的编译器错误消息越来越令人沮丧.这是我的代码:

/*
 * PURPOSE
 *      Do case-insensetive string comparison.
 */
#include <stdio.h>
#include <string.h>
#include <ctype.h>

int compareString(char cString1[], char cString2[]);
char strToLower(char cString[]);

int main() {
    // Declarations
    char cString1[50], cString2[50];
    int isEqual;

    // Input
    puts("Enter string 1: ");
    gets(cString1);
    puts("Enter string 2: ");
    gets(cString2);

    // Call
    isEqual = compareString(cString1, cString2);
    if (isEqual == 0)
        printf("Equal!\n");
    else
        printf("Not equal!\n");

    return 0;
}

// WATCH OUT
//      This method *will* modify its input arrays.
int compareString(char cString1[], char cString2[]) { …
Run Code Online (Sandbox Code Playgroud)

c warnings

22
推荐指数
2
解决办法
21万
查看次数

标签 统计

c ×1

warnings ×1