mirror of
https://github.com/c3lang/c3c.git
synced 2026-02-27 20:11:17 +00:00
20 lines
239 B
C
20 lines
239 B
C
module test;
|
|
import libc;
|
|
|
|
/**
|
|
* @checked *a = *b, *b = *a
|
|
*/
|
|
macro void @swap(&a, &b)
|
|
{
|
|
var temp = *a;
|
|
*a = *b;
|
|
*b = temp;
|
|
}
|
|
|
|
fn void main()
|
|
{
|
|
int x = 123;
|
|
int y = 456;
|
|
@swap(x, y);
|
|
libc::printf("x: %d y: %d\n", x, y);
|
|
} |