Guest User

Untitled

a guest
Oct 17th, 2018
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.15 KB | None | 0 0
  1. ;
  2.  
  3. #if DEBUG
  4. #define ASSERT(_x) Assert(_x)
  5. #else
  6. #define ASSERT(_x)
  7. #endif
  8.  
  9.  
  10. ASSERT(test); // Results in null statement in non-debug builds
  11.  
  12. while (*(dst++) = *(src++))
  13. ;
  14.  
  15. void foo(void)
  16. {
  17. // ...
  18.  
  19. exit:
  20. ;
  21. }
  22.  
  23. while (somethingWithSideEffects()) ;
  24.  
  25. if ( !( overly complex condition ) )
  26. {
  27. do stuff
  28. }
  29.  
  30. if ( overly complex condition )
  31. ; // do nothing
  32. else
  33. {
  34. do stuff
  35. }
  36.  
  37. while (!kbhit())
  38. ;
  39.  
  40. if( scanf("%d",&integer) == 0 )
  41. {
  42. while( getchar() != 'n' ) ;
  43. // ....
  44. }
  45.  
  46. for (;;) // Loop "forever"
  47.  
  48. for (int i=10; i--; ) // 9..0
  49.  
  50. if(condition1)
  51. /* do nothing */ ;
  52. else if(condition2)
  53. do_something;
  54. else do_something_else;
  55.  
  56. if(!condition1 && condition2)
  57. do_something;
  58. else if(!condition1)
  59. do_something_else;
  60.  
  61. if(!condition1) {
  62. if(condition2)
  63. do_something;
  64. else do_something_else;
  65. }
Add Comment
Please, Sign In to add comment