Results 1 to 7 of 7

Thread: simple queue (function header)

  1. #1

    Thread Starter
    Addicted Member nad_scorp's Avatar
    Join Date
    Feb 2001
    Location
    Inside XML
    Posts
    242

    simple queue (function header)

    I've got this class Queue that contains the class extended_queue in the same .h file and the main prog. in the attached file

    It's not so complicated but I keep getting the error

    " missing function header (old-style formal list?) "

    Any help as fast as possible would be appreciated

    the attachment is down in the next post
    Last edited by nad_scorp; Apr 21st, 2002 at 02:02 PM.
    Me "Talented Idiot" by Gtarawneh "He said he's sorry

    Inconsequential is Incommunicable

    The first impression we have
    Is not always the real one
    My reality is not always your
    so my friend....Is life that simple?


    It is called "Israeli occupation forces"

  2. #2
    Zaei
    Guest
    You probably have a semi colon following your function name:
    Code:
    void MyClass:MyMethod();
    {
    
    }
    Z.

  3. #3

    Thread Starter
    Addicted Member nad_scorp's Avatar
    Join Date
    Feb 2001
    Location
    Inside XML
    Posts
    242
    Thanx , big mistake BUT...

    Can anyone check why it still does not run now (redownload it plz)
    Attached Files Attached Files
    Me "Talented Idiot" by Gtarawneh "He said he's sorry

    Inconsequential is Incommunicable

    The first impression we have
    Is not always the real one
    My reality is not always your
    so my friend....Is life that simple?


    It is called "Israeli occupation forces"

  4. #4
    Frenzied Member HarryW's Avatar
    Join Date
    Jan 2000
    Location
    Heiho no michi
    Posts
    1,827
    "It does not run" is not really a very useful description of the problem. I recently formatted and reinstalled, and I don't have a compiler installed to check your code with so I'm looking at it in Notepad. It's a bit difficult to tell what's wrong with it when you don't say what the error is.
    Harry.

    "From one thing, know ten thousand things."

  5. #5
    PowerPoster abdul's Avatar
    Join Date
    Dec 2000
    Location
    Ontario,Canada
    Posts
    2,827
    You get an error saying:
    Qimplement.obj : error LNK2001: unresolved external symbol "public: __thiscall Extended_queue::Extended_queue(void)" (??0Extended_queue@@QAE@XZ)
    Debug/Qimplement.exe : fatal error LNK1120: 1 unresolved externals
    Error executing link.exe.
    This means that you have declared a Constructor (Extended_queue()) in the class Extended_queue and you haven't actually handled it or written any code for that. Either get rid of that or add a function to handle the constructor like this:
    PHP Code:
    //Do whatever you want in this constructor
    Extended_queue::Extended_queue()
    {

    Other than that, the program runs fine but I don't think it does what it's supposed to.
    Baaaaaaaaah

  6. #6

    Thread Starter
    Addicted Member nad_scorp's Avatar
    Join Date
    Feb 2001
    Location
    Inside XML
    Posts
    242
    Here is the file with most functions working except for the
    retrieve_and_serve function and printing the queue,
    so if anyone help me with "retrieve_and_serve " and write code for printing queue ,I'll appreciate it

    P.S the retrieve and serve functions must return a value for retrieve but if I add const as in

    Error_code Extended_queue::serve_and_retrieve(Queue_entry &item) const

    then compiler gives an error on the other variables in the function ofcourse because they're not return values

    Thanx in advance
    Attached Files Attached Files
    Me "Talented Idiot" by Gtarawneh "He said he's sorry

    Inconsequential is Incommunicable

    The first impression we have
    Is not always the real one
    My reality is not always your
    so my friend....Is life that simple?


    It is called "Israeli occupation forces"

  7. #7
    PowerPoster abdul's Avatar
    Join Date
    Dec 2000
    Location
    Ontario,Canada
    Posts
    2,827
    I have no clue what this queue thingy is all about (don't have enough time to look at the whole code) but when add a const to a function, you are saying that the definition inside that function won't effect any variable outside itself. Like you can't do "count--;" in that function if you declare it as const. I don't think it has to do anything with the return value.
    Baaaaaaaaah

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width