Pointer

closed account (o10S216C)
assign pointer pointing to the first (index 0) element and pointer pointing to the last element

how would i write this into my program.
You could do:
1
2
element *first;
element *last;

What are you trying to accomplish?
The first thing you should probably do is research pointers if you haven't already. This link can help:

http://www.cplusplus.com/doc/tutorial/pointers/

Other than that, it seems pretty straightforward what needs to be done, from the information you've given. Create two pointers of whatever type you're using (int, double, char, etc.) and assign one to the first element and the other to the last element using the = operator.

Hope that helps. Again, that link will most likely help you immensely with what you're trying to do.

-

Kurt Bales
UAT Programming Student
Topic archived. No new replies allowed.