c++ - unsigned int value not giving correct result -


following program should print "error" printing success.why?

#include<iostream> using namespace std; int main() {     unsigned int a;    a=-10;     if(a == -10)         cout << "success" ;    else         cout << "error" ;     return 0; } 

the conversion comparison makes them equal again. should cause compiler emit warning.


Comments

Popular posts from this blog

asp.net - repeatedly call AddImageUrl(url) to assemble pdf document -

java - Android recognize cell phone with keyboard or not? -

iphone - How would you achieve a LED Scrolling effect? -