gets problem, for me
It has to be a very simple explanation, but I do not see it. In the program below, I expect, when I enter "quit", that it will break out of the while loop and the program ends. But, it never breaks out of the loop, what am I missing here?
Ray
Board Type - DNA:SQI; Compiler Type - C; Memory Model - CMM; Optimization - Os Size.
Ray
Board Type - DNA:SQI; Compiler Type - C; Memory Model - CMM; Optimization - Os Size.
/**
* @file genTest.c
* This is the main genTest program start point.
*/
#include <stdio.h>
#include <propeller.h>
/**
* Main program function.
*/
int main(void)
{
char buffer[80];
waitcnt(CNT + CLKFREQ);
while(1)
{
printf("> ");
gets(buffer);
if (buffer == "quit") break;
}
return 0;
}

Comments