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

javascript - Js, document.getElementById("ID").innerHTML, error -

objective c - Is there a way in OCMockito to make stubs fail when an unknown method is called? -

jquery - jqGrid update specific column data with out refreshing the entire column? -