0

I have a group project and my role is to make add function to add data permanently to a file, and I have to use dynamic arrays and pointers and I understand what they do but I don't know when to use them so if someone know a video that helps me I would appreciate it or if you can help me on how to begin I would also appreciate it (note : I know how to make file by fstream my problem is using the dynamic arrays and pointers as I don't know where to use them and I have to open a file at the beginning to read from and then save the data on the dynamic arrays with the old data in the old file to a new file at the end of the program)

Mariam
  • 19
  • 4
  • [Earlier Answer Today - C, but applicable here to the memory handling](https://stackoverflow.com/a/67794158/3422102) Note: C++ provides tools to do this without resorting to manual memory allocation and deleting, but if the point is to use those manual tools, that will help. [Additional C++ Example of the Memory Handling](https://stackoverflow.com/a/67249062/3422102) – David C. Rankin Jun 02 '21 at 01:50
  • Better start with a few links that provide basic discussions of pointers. [Difference between char *pp and (char*) p?](https://stackoverflow.com/a/60519053/3422102) and [Pointer to pointer of structs indexing out of bounds(?)...](https://stackoverflow.com/a/60639540/3422102) (ignore the titles, the answers discuss pointer basics) – David C. Rankin Jun 02 '21 at 01:53
  • 1
    Why not use containers like `vector` or `std::string` – prehistoricpenguin Jun 02 '21 at 02:35

0 Answers0