help with queue

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Kceiw

    #1

    help with queue

    I define a class queue in seperate files and it complile correct.
    But error occurs when I compile the main program which uses the defined
    class. It says that there is no such type(class queue).
    I include class queue by ' #include "Queue.h" '
    Why the error occurs?
    Can anyone help me?
  • Rolf Magnus

    #2
    Re: help with queue

    Kceiw wrote:
    [color=blue]
    > I define a class queue in seperate files and it complile correct.
    > But error occurs when I compile the main program which uses the defined
    > class. It says that there is no such type(class queue).
    > I include class queue by ' #include "Queue.h" '
    > Why the error occurs?
    > Can anyone help me?[/color]

    There could be many reasons. It's hard to tell without any code and without
    the exact error message.

    Comment

    • Kceiw

      #3
      Re: help with queue

      Rolf Magnus 写道:[color=blue]
      > Kceiw wrote:
      >[color=green]
      >> I define a class queue in seperate files and it complile correct.
      >> But error occurs when I compile the main program which uses the defined
      >> class. It says that there is no such type(class queue).
      >> I include class queue by ' #include "Queue.h" '
      >> Why the error occurs?
      >> Can anyone help me?[/color]
      >
      > There could be many reasons. It's hard to tell without any code and without
      > the exact error message.
      >[/color]

      Yes. I just find out the error. Some letters' missing.
      Thank you all the same.

      Comment

      • Gernot Frisch

        #4
        Re: help with queue


        "Kceiw" <kceiw@163.co m> schrieb im Newsbeitrag
        news:dv3otk$jt0 $1@news.cn99.co m...[color=blue]
        >I define a class queue in seperate files and it complile correct.
        > But error occurs when I compile the main program which uses the
        > defined
        > class. It says that there is no such type(class queue).
        > I include class queue by ' #include "Queue.h" '
        > Why the error occurs?
        > Can anyone help me?[/color]

        you don't want std::queue, do you?
        that's:

        #inlcude <queue>

        imt main()
        {
        std::queue<int> int_queue;
        }


        Comment

        Working...