c - static variable used with != operator and that too not in if or any loop condition -


#include <stdio.h>  int main() {   static int var;    var!=0;   var+=1;   printf("static value :%d\n",var);   return 0; } 

in above code var!=0 do? , if returns anything, returns?

var!=0 nothing, except comparison, not stored or used in other way . should if used comparison, not use result of comparison:

 if (var!=0)  {      // here  } 

Popular posts from this blog

c# - ODP.NET Oracle.ManagedDataAccess causes ORA-12537 network session end of file -

matlab - Compression and Decompression of ECG Signal using HUFFMAN ALGORITHM -

utf 8 - split utf-8 string into bytes in python -