2009년 3월 9일 월요일

c 언어 swap()

compiler ; Dev C++

#include

void swap(char *p,char *q)
{
char temp;
int i;
for(i=0;i<10;i++)
{
temp=*(p+i);
*(p+i)=*(q+i);
*(q+i)=temp;
}
}


main()
{
char a[10];
char b[10];
scanf("%s\n",&a);
scanf("%s",&b);

swap(a,b);

printf("%s\n",a);
printf("%s\n",b);

system("PAUSE");

}

댓글 없음:

댓글 쓰기

[퍼옴] MPV 단축키 / 환경 설정

  최대한 팟플레이어랑 비슷하게 하려고 했다. 단축키 설정 파일 ~/.config/mpv/input.conf CLOSE_WIN quit TAB script-binding stats/display-stats-toggle ENTER cycle full...