[Return] [Catalog]

1 guest@cc 2018-12-29T01:04:56 [ImgOps] [iqdb]
File: 074-TheMaidOfTheMill-1272x1200… (JPEG, 249.77 KB, 1272x1200)
Lets do KnR exercises.
I'm just pleased cause I solved one I was bothered by, is all.
Program, in C, a function that reverses a string in place, with recursion.
My additional autism dictates that you not use static variables.
If you mean to post a solution, don't look at mine or a solutions wiki until you've written yours, remember!
mine(not formatted because I dont know if code blocks can nest inside spoilers properly):
void reverse(char *f, char *l){
\tchar c = *f;
\tif(f != l+(strlen(l)-1)){
\t\treverse(f+1, l);
\t}
\t*(l+(strlen(f)-1))=c;
}

[Return] [Catalog]
Delete Post:
OptionsPassword
Name
Comment
File