Write a function that takes a C string as an input parameter and reverses the string. The function should use two pointers, front and rear. the front pointer should initially reference the first charachters in the string, and the rear pointer should reference the last charachter. rever the string by swapping the charachters referenced by front and rear then increments front to point to the next charachter, and decrement rear to point the the preceding charachter.

Im not asking for the code, just and idea of what to do. We just started pointers and their confusing to me.
How would i point to the first charachter in the line, with the front pointer, and the last to the rear?

>Im not asking for the code, just and idea of what to do.
The requirements outline your algorithm step by step.

>How would i point to the first charachter in the line

char *front = &line[0];

>and the last to the rear?

char *rear = &line[len - 1];
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.