Cannot understand the C errors

I have this peice of code I was hoping someone could look at. I use valgrind ./a.out to test it and it comes up with errors but none that I can understand.
Maybe someone here could help me.
The code is here:

Honestly - neither we can, as long as you keep them secret.

bakunin

Can you post the errors too...

I ran your code with valgrind. I just ran it up and selected exit. It listed a bunch of leaks. As far as I can tell, you don't release any of the ncurses objects.

I haven't run a scenario, so you may have more in your code.

I built your app as:
cc -g untitled.c -o untitled -lncurses

I ran your app as:
valgrind --leak-check=full --show-reachable=yes ./untitled

what do you mean release the ncurses objects?

Every aquired resource needs to be released whether if be a block of memeory, a file, an ncurses window ... I would have thought that was obvious.

I must have missed that part of the document could you show an example? Lemme post the errors i got also for these guys. It's funny because every error usually has a line number of the problem but this one doesn't. Ok never mind the pasting seems to ignore my \ns so its just jiberish. You gotta compile and use valgrind like he did to see the errors. again none of the errors have line numbers corrisponding which is wierd and gcc doesn't say anything about it.

Are you pasting from a mobile phone or something? This forum doesn't have a problem with newlines.

Even if you do, you can always just add the newlines yourself.

If you don't, we are working blind, and literally cannot help you.

Do not leave people guessing. Show a representative sample of your code and the errors in it, or this thread will be closed.

Corono please compile the file and use valgrind. The errors are so long. and you may be right this desktop might not copy the /n character for some reason but to do what you want is a very unreasonable request.

I and most people don't have valgrind. I may not even get the same errors as you without the same compiler. We literally cannot help you if you don't post your problem. It's completely reasonable to ask for the errors. If you can't, then it hardly matters whether the thread stays open, though I suspect you can find a way.

You might try an alternative web browser. Firefox is known to work well with this site. Smartphones are known to cause problems like you're describing. You might also redirect the errors into a file and open the file in a GUI text editor of some sort.

Do not leave people guessing. Post your code and errors or this thread will be closed, last chance.

1 Like

just close it then

Okay.

I agree with Corona688.

Don't use remote sites like pastebin to attach code here.

Code should be uploaded to this site and not foreign sites.

After this post, I'm proposing a new rule to insure that this type of "remote code pasting" ends sooner than later.

The bottom line is this:

If you want support here in these forums, format yout code and paste it within the forum code tags. Do not use pastebin and other similar remote hosting sites. We don't want these links in our forums.

2 Likes