Thread: Debugging (0xC0000005) error

  1. #1
    Registered User
    Join Date
    Dec 2016
    Posts
    89

    Debugging (0xC0000005) error

    Hi again! Thanks for all the help until now to "laserlight, Salem, GReaper, flp1969 and stahta01.

    I am getting the error in the title. I think the solution is something simple that I am missing. The debugger gives the problem in the picture.

    Debugging  (0xC0000005) error-error_c-png
    Last edited by ArakelTheDragon; 03-16-2019 at 05:58 AM. Reason: The picture was not showing.

  2. #2
    C++ Witch laserlight's Avatar
    Join Date
    Oct 2003
    Location
    Singapore
    Posts
    28,311
    What's your relevant code?
    Quote Originally Posted by Bjarne Stroustrup (2000-10-14)
    I get maybe two dozen requests for help with some sort of programming or design problem every day. Most have more sense than to send me hundreds of lines of code. If they do, I ask them to find the smallest example that exhibits the problem and send me that. Mostly, they then find the error themselves. "Finding the smallest program that demonstrates the error" is a powerful debugging tool.
    Look up a C++ Reference and learn How To Ask Questions The Smart Way

  3. #3
    Registered User
    Join Date
    Dec 2016
    Posts
    89
    Code:
    strupr("ab");
    I found the error, the function takes "char *" which is an array. When I change it to "strupr(Buffer);" it works.

  4. #4
    Registered User
    Join Date
    Dec 2016
    Posts
    89
    Can I ask why do I get this error "unknown conversion type character 'l' in format [-Wformat=]|", for "printf("%lli", dec)"?

  5. #5
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    38,621
    1. strupr() isn't a standard function.
    2. From the look of things, strupr() expects to be able to modify the string. But "ab" is a string constant in read-only memory, which will cause it to fail.

    char msg[] = "ab";
    strupr(msg);

    You need to point to memory you can change.
    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.

  6. #6
    Registered User
    Join Date
    Feb 2019
    Posts
    851
    Quote Originally Posted by ArakelTheDragon View Post
    Can I ask why do I get this error "unknown conversion type character 'l' in format [-Wformat=]|", for "printf("%lli", dec)"?
    Should work... From MSDN printf formats document, 'll' modifier is acceptable. On GCC it is also ok!

  7. #7
    Registered User
    Join Date
    Dec 2016
    Posts
    89
    I am using "GCC" with codeblocks, but it does not works. I read online that this is the proper format, but I guess I might be missing something(a step) or some setting in Codeblocks has to be changed.

  8. #8
    C++ Witch laserlight's Avatar
    Join Date
    Oct 2003
    Location
    Singapore
    Posts
    28,311
    %lli is standard, but there's a possibility that on Windows, the GCC port may be dependent on an old version of MSVCRT that requires %I64i instead.
    Quote Originally Posted by Bjarne Stroustrup (2000-10-14)
    I get maybe two dozen requests for help with some sort of programming or design problem every day. Most have more sense than to send me hundreds of lines of code. If they do, I ask them to find the smallest example that exhibits the problem and send me that. Mostly, they then find the error themselves. "Finding the smallest program that demonstrates the error" is a powerful debugging tool.
    Look up a C++ Reference and learn How To Ask Questions The Smart Way

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 3
    Last Post: 04-18-2012, 08:49 AM
  2. Replies: 3
    Last Post: 07-02-2011, 05:20 AM
  3. Debugging error
    By vexed in forum C Programming
    Replies: 3
    Last Post: 03-08-2011, 01:44 PM
  4. Debugging error
    By vexed in forum C Programming
    Replies: 5
    Last Post: 03-08-2011, 11:46 AM
  5. 0xc0000005 error
    By Hankyaku in forum C++ Programming
    Replies: 32
    Last Post: 03-14-2008, 04:20 PM

Tags for this Thread