Toggle navigation
Home
Latest pastes
FAQ
Random
BitBin is shutting down!
Register
Login
my_evil_str.c
SUBMITTED BY:
Guest
DATE:
Nov. 29, 2013, 6:38 p.m.
FORMAT:
Text only
SIZE:
721 Bytes
Raw
Download
Tweet
HITS:
3639
Go to comments
Report
int my_strlen(char *str)
{
int nb;
nb = 0;
while (str[nb] != '\0')
{
nb = nb + 1;
}
return nb;
}
int my_putstr(char *str)
{
int nb;
nb = 0;
while (str[nb] != 0)
{
my_putchar(str[nb]);
nb = nb + 1;
}
}
char *my_evil_str(char *str)
{
int start;
int max;
int mid;
char save;
start = 0;
max = my_strlen(str);
mid = max / 2;
max = max - 1;
while (start < mid)
{
save = str[start];
str[start] = str[max];
str[max] = save;
start = start + 1;
max = max - 1;
}
}
Please enable JavaScript to view the
comments powered by Disqus.
comments powered by
Disqus