There are some standard ways to ask questions that elicit positive responses.
You can use pseudo-code. If you do so, under no circumstances should it look like something a noob whipped up without any thought. One good way to do this is not to write it in any programming language you know. However, even here, variable names must be followable.
Or you can use a short example of your code. It must be compilable (unless your question is "why doesn't this compile?"). It must be runnable. And it must produce the error scenario you describe. This makes it easy for those who may have an idea on how to help you to actually, you know, help. They can load your code into their debugger, go at it line by line, and possibly give you some insight into your issue. It also helps if you follow some sort of coding standards. It doesn't have to be the One True Brace Style, but it has to be something consistent and has to lend itself to being readable to others. If this all means you need to heavily edit your code before posting, it will at least be obvious that you put some effort in to being helped, making it more likely others will help you. Or at least it won't look like a big ball of mud and that you put no effort into being helped.
Of course, when you do all that, you'll start to find that you solve your own problem. It might be more work, but it'll solve your issue faster than waiting for some random monk to happen upon your node and take the challenge of helping you with a reply.