- #1
eatsleep
- 42
- 0
C: "warning assignment makes integer from pointer without a cast"
1. I am trying to assign a color to the variable choice if it is equal to one of the 3 input numbers.
I have already initilized choice as a character variable and pred as an integer variable. I am not sure what I am missing but I keep getting the error "warning assignment makes integer from pointer without a cast".
1. I am trying to assign a color to the variable choice if it is equal to one of the 3 input numbers.
Code:
if(pred==1) {
choice = "RED";
}
else if(pred==2) {
choice = "GREEN";
}
else if(pred==3) {
choice = "BLUE";
}
Last edited by a moderator: