Like Zipster said, there may be other considerations at play here.
As far as the code itself goes though, a couple questions. First, does it compile? Second, have you tested it, and does it produce the desired results?
Something you might consider is setting aside the DLL issue for now and just focusing on implementing this in isolation, maybe even in a self-contained single-file terminal or command-line app. That way you could post your code in its entirety for others to look at.
What you have there appears to be the same thing you had before, just expressed differently. As such, it still likely doesn't do what you want.
Although I mentioned std::vector earlier, you might benefit from implementing this without such tools first in order to better understand the underlying concepts. How familiar are you with topics such as arrays, pointers, and manual memory management?