This code is intended to call the s () function every time I press the s key. But instead, the s () function is constantly called:
#include <stdio.h> void s() { printf("What?"); } int main(void) { char control; while(1) { control = getch(); if(control = 's') { s(); } } }
if(control == 's')you assign=instead of compare==wrote - Mike