这个C警告意味着什么?"int格式,指针arg"

Pie*_*ter 1 c printf

#include <stdio.h>

int main() {
    // Declarations
    int iCount1, iCount2;
    int iXXTest[4][3] = {{2, 3, 5}, {9, 8, 6}, {1, 8, 4}, {5, 9, 7}};

    // Walk through 1st dimension
    for (iCount1 = 0; iCount1 < 4; iCount1++) {
        // Walk through 2nd dimension
        for (iCount2 = 0; iCount2 < 3; iCount2++) {
            printf("iXXTest[%d][%d] is at address %d and has a value of %d.\n", iCount1, iCount2, &iXXTest[iCount1][iCount2], iXXTest[iCount1][iCount2]);
        }
    }

    return 0;
}
Run Code Online (Sandbox Code Playgroud)

此行生成警告:

printf("iXXTest[%d][%d] is at address %d and has a value of %d.\n", iCount1, iCount2, &iXXTest[iCount1][iCount2], iXXTest[iCount1][iCount2]);
Run Code Online (Sandbox Code Playgroud)

int格式,指针arg(arg 4)

这个警告是什么,我该如何解决?

Jon*_*eet 14

这意味着你已经使用了%d的格式(对于整数),但参数实际上是一个指针.请改用%p.