I really do suggest dumping the C library random functions and learning to use C++ <random> library.
https://web.archive.org/web/20180123103235/http://cpp.indi.frih.net/blog/2014/12/the-bell-has-tolled-for-rand/
Random Number Generation in C++11
https://www.open-std.org/JTC1/SC22/WG21/docs/papers/2013/n3551.pdf
Theoretically with each word placement there could/should be three things randomly generated:
1. The element for the starting location. Yes, that is actually two numbers, but it is one location within the puzzle grid.
2. The direction of placement: horizontal, vertical, diagonal increase (column number increases as each letter is placed), diagonal decrease.
3. The direction the word is placed. Forwards or backwards.
When you know the parameters of where and how the current word is to be placed you then try to figure out if the word:
1. goes out of bounds
2. overlaps another already placed word.
If either condition is true you start over with a new location and direction and try again.
If the word doesn't go out of bounds and there is no conflicting word you loop though the extent of the word and place char by char the word into the puzzle grid.
Mark the word as placed and Lather, Rise and Repeat until all the words are on the grid.
As I said earlier, having an idea of the what needs to be done before you code is helpful in the extreme. Coding and then adding features without a plan is gonna bite you on the
tuchus.