Simple random small map generator.(Not simple to me x.x)

// I want to make a project for myself, so my goal is to create a small 16 x 16 grid-field of characters to represent the map to move around in. Let's say for now(as I'm not sure) that an empty area of the map that you can move around in is a hyphen(-), an obstacle is a zero(0), your movable character is an X, and the finish point is a pound(#).
// For now, my only real focus is the map generation portion, so until then I'm not worried about what happens if I hit an obstacle, or even moving the character yet for that matter. The movable character always starts at the top-left of the grid, and the finish point always at the bottom-right. When the map is generated then obstacles are randomly placed on the map, but I need to make sure that there is always a path from the start to finish. I'm going with a simple idea of making so that an obstacle cannot be generated within 1 character of another obstacle(nor player or finish point), including diagonally. This is the part that I'm worried about and is making me wonder how I'm going to do that...

// So, I don't really need code(unless that helps the understanding), but I just need someone to maybe get me to think in the right way of how to look and solve this problem. I'd be using a two-dimensional vector or array, I think... now I need to figure out how to get an obstacle to check in all 8 directions for another obstacle to determine if it is allowed to generate there or not. Now I'm wondering what about when it's on an edge, ah! I'm gaining understanding as I write this, but...hmm..

// Oh, another question is will the map stay in a square shape with these other characters? If not, would using, say, wide characters solve this(perhaps make it more of a rectangle though then)?
What you want is very similar with the problem of counting islands. There is someone else that posted it two days ago:
http://www.cplusplus.com/forum/beginner/41192
Topic archived. No new replies allowed.