Thread: ESP error??????/

  1. #1
    Registered User
    Join Date
    Jun 2003
    Posts
    147

    ESP error??????/

    I have attached a zip file. the main file is Startup.C. compile and run it, for username = francis, password = Kheng

    once in the main m enu, choose number 4

    somehow, after it executes, the program rightfully ends, but after it shows the "THE END" statement, an internal C runtime error seems to popup, saying something to do with ESP which i have never seen before!

    could any of you check out and see if you get the same error too?

    i'm using windows xp and visual studio 6.0 C++

    the problem can be traced to the function 'subMenu' in the Reporting.h file...

    if u take away the call to this function in the Startup.C file at line 34...
    Only by the cross are you saved...

  2. #2
    Registered User
    Join Date
    Jun 2003
    Posts
    245
    ESP errors mean your overwriting the stack where you shouldn't, which is usually the case of a locally defined array which is being overrun/underrun.

  3. #3
    Registered User
    Join Date
    Jun 2003
    Posts
    147
    sdorry for the late reply, wat is wrong with void subMenu(void)?

    char menuitems(char NAME[])

    isn't this the right way to receive a string parameter in a function header?
    Only by the cross are you saved...

  4. #4
    Registered User
    Join Date
    Jun 2003
    Posts
    147
    done a few changes, like resizing the size of buf and buf2, still the error is present...
    Only by the cross are you saved...

  5. #5
    Registered User
    Join Date
    Jun 2003
    Posts
    147
    here it is, i'm really baffled, but the error does not pop up if i disable the subMenu call from the startup.C file under the switch statement...

    the error also pops up after the last line of code is executed in the startup.C file, after it prints "THE END"
    Only by the cross are you saved...

  6. #6
    Registered User
    Join Date
    Jun 2003
    Posts
    147
    i searched somewhere, and someone who faced a similar problem said that he/she removed the '/GZ' word from the command line list box located under Project, Settings, under the C/C++ tab, it did work for me, but i am afraid of continuing to do this becoz i don't want to tamper with these project settings as they should be as default...i have read that the error i am facing seems to be caused by a mismatch in function calling conventions...however, i see none of that in my program, unless i've missed out, also, this error onli comes up when the program ends...so how do i traqce such an error?
    Only by the cross are you saved...

  7. #7
    Registered User
    Join Date
    Jun 2003
    Posts
    147
    hm........i see, that solved it...

    but T2 stands for "\t\t", i tot this represents 2 characters
    than i have 2 spaces, and a character symbol...

    that's 5 ain't it?
    Only by the cross are you saved...

  8. #8
    Registered User
    Join Date
    Jun 2003
    Posts
    147
    oh yeah, one of u also mentioned that i should not put executable codes in .h files, ist here any reason for this?

    anywhere i could read bout header files?

    coz my lecturer showed me an example, a nd he had executable code likek mine inside his .h file too...

    so just wnana know if there's any reason for wat one of u said...
    Only by the cross are you saved...

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. An error is driving me nuts!
    By ulillillia in forum C Programming
    Replies: 5
    Last Post: 04-04-2009, 09:15 PM
  2. Another syntax error
    By caldeira in forum C Programming
    Replies: 31
    Last Post: 09-05-2008, 01:01 AM
  3. Making C DLL using MSVC++ 2005
    By chico1st in forum C Programming
    Replies: 26
    Last Post: 05-28-2008, 01:17 PM
  4. ras.h errors
    By Trent_Easton in forum Windows Programming
    Replies: 8
    Last Post: 07-15-2005, 10:52 PM
  5. Couple C questions :)
    By Divx in forum C Programming
    Replies: 5
    Last Post: 01-28-2003, 01:10 AM