Debug Assertion Failed!

Discussion in 'C++' started by jerry, Aug 21, 2008.

  1. jerry

    jerry Guest

    i have a problem:
    when i run a program,it pop up a windows,title is
    microsoft visual c++ failed!
    contents are:
    program: ...io\myprojects\phonebook\debug\phonebook.exe
    file:fopen.c
    line:54
    expression: *file !=_T('\0')
    for information on how your program can cause an assertion failure,see
    the visual c++ doucmention on asserts.
    (please retry to debug the application)
    abort(A) retry(R) ignore(I)

    can someone give me a suggestion ,where's the fopen.c what dose
    *file !=_T('\0') mean,and where can
    i get documentation on asserts?
    ps. befor it occures,my program run at :
    if (!fout.is_open ())
    {
    cerr << "Can't open file: " << fileName;
    exit(EXIT_FAILURE);
    }
    and if i select ignore
    the cmd windows display Can't open filepress any key
    to continue.
    thanks a lot!
     
    jerry, Aug 21, 2008
    #1
    1. Advertising

  2. jerry

    peter koch Guest

    On 21 Aug., 17:36, jerry <> wrote:
    > i have a problem:
    > when i run a program,it pop up a windows,title is
    > microsoft visual c++ failed!
    > contents are:
    > program: ...io\myprojects\phonebook\debug\phonebook.exe
    > file:fopen.c
    > line:54
    > expression: *file !=_T('\0')
    > for information on how your program can cause an assertion failure,see
    > the visual c++ doucmention on asserts.
    > (please retry to debug the application)
    > abort(A) retry(R) ignore(I)
    >
    > can someone give me a suggestion ,where's the fopen.c  what dose
    > *file !=_T('\0') mean,and where can
    > i get documentation on asserts?
    > ps. befor it occures,my program run at :
    >         if (!fout.is_open ())
    >         {
    >                 cerr << "Can't open file: " << fileName;
    >                 exit(EXIT_FAILURE);
    >         }
    > and  if i select ignore
    > the cmd windows display Can't open filepress any key
    > to continue.
    > thanks a lot!


    It tells you that you have passed a string of length 0 (the first
    character is \0) as the filename to fopen.
    assert should be described in your favourite C/C++ book - if it is
    not, use google.

    /Peter
     
    peter koch, Aug 21, 2008
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. SorceCode
    Replies:
    2
    Views:
    3,372
    Christian Janßen
    Jan 26, 2004
  2. Cormac
    Replies:
    3
    Views:
    2,578
    Kevin Goodsell
    Apr 6, 2004
  3. w3r3w0lf

    debug assertion failed

    w3r3w0lf, Apr 15, 2004, in forum: C++
    Replies:
    2
    Views:
    2,565
    John Harrison
    Apr 15, 2004
  4. Kapt. Boogschutter

    Debug Assertion Failed! and no obvious Error

    Kapt. Boogschutter, Jun 23, 2004, in forum: C++
    Replies:
    1
    Views:
    597
    red floyd
    Jun 23, 2004
  5. Arti Potnis
    Replies:
    2
    Views:
    6,700
    Howard
    Sep 2, 2004
Loading...

Share This Page