4.12
void reverse(char str[], int before, int behind){
int c;
if(before < behind){
c = str[before];
str[before] = str[behind];
str[behind] = c;
reverse(str, before + 1, behind-1);
}
}
4.13
void itoa(int n, char s[]){
static int i;
if(n / 10){
itoa(n / 10, s);
} else {
i = 0;
if( n < 0){
s[i++] = '-';
}
}
s[i++] = (n % 10) + '0';
s[i] = '\0';
}
4.14
#include <stdio.h>
#define swap(t, x, y) { t _z; \
_z = y; \
y = x; \
x = _z; }
int main(){
int a = 4;
int b = 5;
swap(int , a, b);
printf("a = %d\n", a);
return 0;
}