I assume from the picture you posted on StackOverflow that your world is tile-based, and you're after something like this. Then you can probably use the same data structure that you're already using for storing the map and rendering, when doing the collision detection in your game.
The first question I have to ask is, how does your character move - does it "teleport" between tiles, or does it move continuously in the world? The answer depends on that piece of information.
Player Teleports between Tiles
In the first case, it's extremely simple to deal with collisions. Whenever you're trying to move the character, just check if the block that he'll be moving into is a wall, and abort the move if that's the case.
Player Moves Continously
In the second case, it's a bit more complicated, but I already explained how to do this before in another question. There's a source code example in that answer, but it's written for C# and XNA so you'll have to adapt. The idea is language agnostic though:
- Move character in one dimension (e.g. horizontally).
- After the move, find all tiles that intersect the character's bounding box.
- For each of them, detect collisions with walls and resolve them by moving the player back by the penetration amount.
- Repeat the process for the other dimension (e.g. vertically).
Note: I found that doing this process separatedly for horizontal and vertical movement helped guard against a series of edge case problems, hence my suggestion.