/*********************************************************************** **assign.c --- A sample source that shows an assignment error --- ****** ********************************** ************************************/ #include #include int assign(int x) { if(x=1) /*Assignment operator is substituted for an equality test operator. The assignment operation will always return the assigned value, in this case "1". Thus, the statement is always a nonzero and the true-part is always executed.*/ return 1; /*Always executed.*/ else return 0; /*Never executed.*/ } /*Prototype main function*/ int main(int argc, char * argv[]) { /*Conversion of command line argument to an integer.*/ int i = atoi(argv[1]); /*Output to the standard output device the result of the call to the function "assign()".*/ printf("%d \n",assign(i)); /*Return to O.S.*/ return 0; }