This week only. Pastebin PRO Accounts Christmas Special! Don't miss out!Want more features on Pastebin? Sign Up, it's FREE!
Guest

Untitled

By: a guest on Feb 25th, 2013  |  syntax: C  |  size: 0.33 KB  |  views: 18  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  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. }
clone this paste RAW Paste Data