Like this: C is fun! !nuf is C
Here is what I have so far:
#include <stdio.h>
void reverse(const char * const sPtr);
int main(void) {
// Local Variables
char sentence[80];
// Begin
printf("Enter a line of text:\n");
gets(sentence);
printf("\nThe line reversed is:\n");
reverse(sentence);
return 0;
} //end function main
void reverse(const char * const sPtr){
while(sPtr[0]!='\0'){
putchar(sPtr[0]);
break;
}
} //end function reverse
Right now it enters an infinite loop without the break, but it at least prints the first character. All I need help with is getting the reversal function to print the input backwards, the main function works just fine.

New Topic/Question
Reply




MultiQuote






|