You should take the third example program on the notes for April 18th and revers
ID: 3642336 • Letter: Y
Question
You should take the third example program on the notes for April 18th and reverse the string using pointers.-------------------
Thrid example
// Program that illustrates how to read an array using pointers
#include <stdio.h>
void main()
{
char x[8] = {'s','t','r','e','s','s','e','d'};
char *ptr; /* pointer of type char */
ptr = x; /* assigns the addres of the
first element of the array to ptr */
int i = 0;
for (i = 0; i<8; i++)
{
printf("%c", *ptr);
ptr++; // points to the next element in the array
}
}
Explanation / Answer
What is your Question?? Confused
Related Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.