More actions
imported>joojis No edit summary |
(Repair batch-0005 pages from live compare) |
||
| Line 45: | Line 45: | ||
return 0; | return 0; | ||
} | } | ||
Latest revision as of 00:45, 27 March 2026
출석
*권우성
수업 내용
스왑
void swap(int *a, int *b){
int temp;
temp=*a;
*a=*b;
*b=temp;
}
//분석해보세요
void swap(int *a, int *b){
if((*a)!=(*b)){
*a^=*b^=*a^=*b;
}
}
int main()
{
int x=5, y=10;
printf("%d %d\n", x, y);
swap(&x, &y);
printf("%d %d\n", x, y);
return 0;
}
문자열 출력
void printstring(char *ptr){
while(*ptr){
putc(*ptr, stdout);
ptr++;
}
}
int main()
{
printstring("abcd");
return 0;
}