Created
January 18, 2013 14:43
-
-
Save ncaq/4565001 to your computer and use it in GitHub Desktop.
重要なのは一行目のみ. 昔暇な時に考えた.
後で検索したら苦しんで覚えるC言語とかに書いてあった.
しかももっとよい方法だった.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#define swap(a,b) (a=a+b,b=a-b,a=a-b) | |
#include <stdio.h> | |
void printAB(int a,int b) | |
{ | |
printf("a:%d,b:%d\n",a,b); | |
} | |
int main() | |
{ | |
int a = 0; | |
int b = 1; | |
printAB(a,b); | |
swap(a,b); | |
printAB(a,b); | |
return 0; | |
} |
いや,まあうん,バンバン使おう的なことは言ったけど,だからといって人のgistをtestの場所にするのはやめ…
は!gistとtestってなんか似てるな!もしやここははじめからtestの場所だったのか…!?
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Test