incompatible pointer to integer conversion assigning to 'int' from 'string'

Viewed 24

I am getting this warning when I am trying to assign a name to my array.

bool vote(int voter, int rank, string name) {
    
    preferences[voter][rank] = name;
    return false; }

I need to input a name in the function, that will move to the place of preferrences[i][j]. First time asking a question, so I am sorry if it is incomplete.

The full error:

clang -ggdb3 -O0 -std=c11 -Wall -Werror -Wextra -Wno-sign-compare -Wno-unused-parameter -Wno-unused-variable -Wshadow    runoff.c  -lcrypt -lcs50 -lm -o runoff
runoff.c:131:30: error: incompatible pointer to integer conversion assigning to 'int' from 'string' (aka 'char *') [-Werror,-Wint-conversion]
    preferences[voter][rank] = name;
0 Answers
Related