Advertisement

A good pointer exercise?

Started by December 10, 2002 06:01 PM
1 comment, last by MonsterTaco 21 years, 11 months ago
I was just going over pointers in C++ and think I have it down now. I''d like to do a small exercise to make sure I know what i''m doing with pointers. What''s a good real world example that deals with pointers, pointers with arrays, and using pointers in functions etc..? I was thinking of making a linked list?
Dynamic data structures like linked lists are excellent examples of situations where pointers are useful. I personally think that every programmer should write a linked list class once in their life ... just be aware that as a C++ programmer, you''re probably better off using std::list. (I still think you should write a linked list class for the learning experience and to gain some understanding of what goes on underneath, but once you have it, use std::list, because it''s probably better than anything any of us here can write ...)
Advertisement
try to make your own string (class).

My compiler generates one error message: "does not compile."

This topic is closed to new replies.

Advertisement