Hi,
The following code generates the error:"error C2106: '=' : left operand must be l-value"
Can you tell me what is the reason?Code:// This is the main project file for VC++ application project // generated using an Application Wizard. #include "stdafx.h" #include "stdio.h" #using <mscorlib.dll> using namespace System; #define IN 1 /* inside a word */ #define OUT 0 /* outside a word */ /* count lines, words, and characters in input */ main() { int c, nl, nw, nc, state; state = OUT; nl = nw = nc = 0; while ((c = getchar()) != EOF) { ++nc; if (c == '\n') ++nl; if (c == ' ' || c == '\n' || c = '\t') state = OUT; else if (state == OUT) { state = IN; ++nw; } } printf("%d %d %d\n", nl, nw, nc); }
Thanks!!



LinkBack URL
About LinkBacks




