write a c program to reverse a character array using pointers
1
Expert's answer
2015-12-18T06:59:32-0500
/* Question#56995, Programming, C */
#include <stdio.h>
void revers( char *str ) { int n=0; // char counter; int i=0; while ( *str!= '\0') // set pointer to the end of the string { str++; //poinetr n++; } str--; for(i=n; i>0; i--) // reverse print of the string { printf("%c",*str); str--; } }
Comments
Leave a comment