Thread: memory fault?

  1. #1
    Registered User
    Join Date
    Sep 2006
    Posts
    3

    Unhappy memory fault?

    Hi guys,
    I'm trying to complete an assignment. The school provides us with sample input files and also shows us what the output will look like. I have tested these continuously, however, when i went to submit it, the school has an auto-testing thing and my codes dont work saying instead I have a memory fault. Any notes on how to fix that?

    Thanks

  2. #2
    Code Goddess Prelude's Avatar
    Join Date
    Sep 2001
    Posts
    9,897
    The answer to your question is 101010. Have a nice day!
    My best code is written with the delete key.

  3. #3
    Devil's Advocate SlyMaelstrom's Avatar
    Join Date
    May 2004
    Location
    Out of scope
    Posts
    4,079
    Quote Originally Posted by Prelude
    The answer to your question is 101010. Have a nice day!
    Oh... that should so be an automated answer...
    Sent from my iPadŽ

  4. #4
    Code Goddess Prelude's Avatar
    Join Date
    Sep 2001
    Posts
    9,897
    You're quick, but I'm godly. I made it more geeky.
    My best code is written with the delete key.

  5. #5
    Registered User
    Join Date
    Sep 2006
    Posts
    3
    huh?

  6. #6
    Code Goddess Prelude's Avatar
    Join Date
    Sep 2001
    Posts
    9,897
    >huh?
    Exactly! What gave you the idea that anyone would be able to help you with such a vague question?
    My best code is written with the delete key.

  7. #7
    Registered User
    Join Date
    Sep 2006
    Posts
    3
    well i'm really really new to programming and I don't know how else to ask?

  8. #8
    Devil's Advocate SlyMaelstrom's Avatar
    Join Date
    May 2004
    Location
    Out of scope
    Posts
    4,079
    Sent from my iPadŽ

  9. #9
    Code Goddess Prelude's Avatar
    Join Date
    Sep 2001
    Posts
    9,897
    >well i'm really really new to programming and I don't know how else to ask?
    Common sense transcends skillsets. When asking a question about anything you provide as much information as possible, right? I can tell you things that would cause a memory fault, but if one of them turned out to be your problem, it would be nothing more than dumb luck on my part because you haven't show us any code, and all I would be going on is the phrase "memory fault".
    My best code is written with the delete key.

  10. #10
    Registered User
    Join Date
    Apr 2006
    Posts
    2,149
    memory fault generally means that you missused pointer somehow. It can mean that you made your strings one size to small (remmember to make room for the null character). It can also mean that you're derefferencing a null pointer. There are other things too.

    BTW, I think this is a perfectly valid question. However, lyn_f, you might consider posting your code so we can help you identify the portion of your code that is causing the memmory fault (assuming the program is not too long).
    It is too clear and so it is hard to see.
    A dunce once searched for fire with a lighted lantern.
    Had he known what fire was,
    He could have cooked his rice much sooner.

  11. #11
    Code Goddess Prelude's Avatar
    Join Date
    Sep 2001
    Posts
    9,897
    >BTW, I think this is a perfectly valid question.
    It would be if we had the context required to answer it. A memory fault is by far the most elusive and frustrating of bugs. They take forever to find because there are so many ways to cause them and their locality is usually ridiculous.
    My best code is written with the delete key.

  12. #12
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    39,664
    In case you still haven't figured it out, finding the problem takes source code.

    So post some.

    And don't forget to use [code][/code] tags.
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.

  13. #13
    Cat without Hat CornedBee's Avatar
    Join Date
    Apr 2003
    Posts
    8,895
    Quote Originally Posted by Prelude
    A memory fault is by far the most elusive and frustrating of bugs. They take forever to find because there are so many ways to cause them and their locality is usually ridiculous.
    I disagree. Memory corruptions that do not cause faults are even more elusive, and usually take longer to notice.
    All the buzzt!
    CornedBee

    "There is not now, nor has there ever been, nor will there ever be, any programming language in which it is the least bit difficult to write bad code."
    - Flon's Law

  14. #14
    Code Goddess Prelude's Avatar
    Join Date
    Sep 2001
    Posts
    9,897
    >Memory corruptions that do not cause faults are even more elusive, and usually take longer to notice.
    That would be a memory fault as well. Perhaps I should have made it clear that I was talking about a class of bugs rather than a specific system error.
    My best code is written with the delete key.

  15. #15
    Registered User
    Join Date
    Apr 2006
    Posts
    2,149
    Quote Originally Posted by Prelude
    >BTW, I think this is a perfectly valid question.
    It would be if we had the context required to answer it. A memory fault is by far the most elusive and frustrating of bugs. They take forever to find because there are so many ways to cause them and their locality is usually ridiculous.
    Yes, but lyn_f doesn't know that. He's just asking what a memory fault is, and what are likely causes.
    It is too clear and so it is hard to see.
    A dunce once searched for fire with a lighted lantern.
    Had he known what fire was,
    He could have cooked his rice much sooner.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Memory allocation/reallocation
    By magda3227 in forum C Programming
    Replies: 10
    Last Post: 07-04-2008, 03:27 PM
  2. To find the memory leaks without using any tools
    By asadullah in forum C Programming
    Replies: 2
    Last Post: 05-12-2008, 07:54 AM
  3. Memory Leak Help
    By (TNT) in forum Windows Programming
    Replies: 3
    Last Post: 06-19-2006, 11:22 AM
  4. Locating A Segmentation Fault
    By Stack Overflow in forum C Programming
    Replies: 12
    Last Post: 12-14-2004, 01:33 PM
  5. Pointer's
    By xlordt in forum C Programming
    Replies: 13
    Last Post: 10-14-2003, 02:15 PM