how to reverse a character string inplace using recursive functions
how to reverse a character string inplace using recursive functions
I hope you fail your course.Code:#include <stdio.h> void rev(char *s) { if ( *s != '\0' ) rev(s+1); putchar(*s); } int main(void) { rev("citizen gets paid by lazy students."); putchar('\n'); return 0; }
thank you sir for the soliution as well as the suggestion. now i am no more a failure
> now i am no more a failure
ROFLMAO
No, your success depends on being spoon-fed by others.
Success is doing it yourself, not getting lucky by finding an answer on a message board.
If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
If at first you don't succeed, try writing your phone number on the exam paper.