SHARE
TWEET

Untitled

a guest Feb 25th, 2013 18 Never
  1. unsigned int doSomething(unsigned int *x, int y)
  2. {
  3.     if(1) //works
  4.     if(y) //reports the error given below
  5.  
  6.     //I use any one of the ifs above, and not both at a time
  7.  
  8.     return ((*x) + y); //works fine when if(1) is used, not otherwise
  9. }
  10.  
  11. int main() {
  12.         unsigned int x = 10;
  13.         doSomething(&x, 1);
  14. }
RAW Paste Data
Top