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");

}

댓글 없음:

댓글 쓰기

gThumb segmentation fault after recent updates

 solutions $ gsettings set org.gnome.gthumb.general active-extensions [] source: https://www.reddit.com/r/Ubuntu/comments/1rxiw9u/gthumb_seg...