   Point of pointers
  I know how pointers work and all... but I have yet to actually apply them in such a way that they seem useful (besides file manipulation).Can anyone refer me to a website or a set of simple C++ source files?  If I see 2 programs that do they same thing but one uses pointers while the other does not it might help me finally see the light. 
  They''re useful if you want a function to accept a structure, or to return one, without copying the whole structure on to the stack. You can just pass the address of your structure into the function.   Why you shouldn''t use iostream.h - ever! | A Good free online C++ book;  A quick example would be something like this:void ProcessData1(unsigned char *data, int datalength);void ProcessData2(unsigned char data[4096], int datalength);Calling ProcessData2 would copy the entire data array onto the stack whilst changing functions, whilst calling ProcessData1 you can simply pass a pointer to it... copying 4 bytes is faster than copying 4096, and if *data happens to be larger than 4096 bytes, theres no buffer overflow.. no need to trim it for the function.Another use is for linked lists, where you can have dynamically sized "arrays" of sorts. Allocate a new node in it as needed, and delete ones which are no longer needed... only use the memory thats actually needed. Very useful for managing data as well.For games, you could have your monster structure have a "model" pointer that points to a model structure for the model of that monster. Instead of loading the model once for each monster that uses it, load it once, and have the monster structures point at a single instance of that model.Thats the very basics in where you would want to use pointers. Its not exactly what you asked for (code or a website), but it should give you some idea of where pointers can be incredibly useful.BTW Im writing this at 3:15am and Im tired, so I hope that what I wrote makes sense... if not, someone else can cover for me  -----------------------"When I have a problem on an Nvidia, I assume that it is my fault. With anyone else''s drivers, I assume it is their fault" - John Carmack ;  Pointers supply indirection, which means they make it possible for code to operate at runtime on locations that are unknown at compile time. Every other construct (with the exception of references, which are really like compiler-maintained pointers with a few restrictions) needs to be statically determined when the code is compiled, but a pointer is simply an address holder. When the code is executed that holder gets filled with a real-world memory address and the code then attempts to operate on the address.There are restrictions on which addresses your code can access, which is the origin of access violations, so much of pointer difficulty arises from overstepping application bounds. These restrictions are not terribly confining, though, so even more pointer difficulty arises from accessing shared locations that are legal but logically flawed - perhaps overwriting memory being used by another application or memory being used by the same application but for another purpose.Because pointers hold addresses determined at runtime, they are the  primary mechanism for dynamic memory allocation where the offset of the allocated memory is not known until allocated (the only other option is a reference, which may limit reallocation and may involve dereferencing the returned offset first). The third root cause of pointer confusion is improperly managing pointers being used to indicate dynamically allocated memory - particularly failing to deallocate the memory before the pointer is destroyed. 