ACSUtils Wiki

An ACS library for ZDoom-based ports

User Tools

Site Tools


new:swap

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
new:swap [2018/02/19 12:42] korshunnew:swap [2019/09/05 23:41] (current) – removed korshun
Line 1: Line 1:
-====== swap ====== 
-''any, any swap(any a, any b)'' 
  
-[[new:multiple_return_values|Returns two variables]] in reverse order. This function exists to improve readability when swapping the values of two variables. 
- 
-===== Examples ===== 
-Without ''swap()'': 
-<code> 
-int tmp = x; 
-x = y; 
-y = tmp; 
-</code> 
- 
-With ''swap()'': 
-<code> 
-swap(x, y); 
-x = r1; 
-y = r2; 
-</code> 
new/swap.1519036953.txt.gz · Last modified: 2018/02/19 12:42 by korshun