Search:

Type: Posts; User: ovid

Page 1 of 2 1 2

Search: Search took 0.00 seconds.

  1. Replies
    1
    Views
    3,300

    Backtracking algorithm??

    Hi, I'm confused if it's possible to find exact one solution using backtrack algorithm?
    Usually backtracking search the entire solution spaces.
    I wonder if I can use it to find a feasible solution...
  2. Replies
    5
    Views
    1,190

    Thx a lot. I am embarrassed I didn't figure out I...

    Thx a lot. I am embarrassed I didn't figure out I miss the const specifier.
    However, I didn't know passing a temporary object to a non const reference is illegal while to const one is valid. ...
  3. Replies
    5
    Views
    1,190

    About passing reference question

    I have a question about passing reference
    I have a function prototype like void Queue::enqueue(Const Obj& o);
    The first case, I try to pass a temp Obj instance to a function
    but compile error...
  4. Replies
    3
    Views
    1,864

    Manager class derived from the Base is because...

    Manager class derived from the Base is because that third party package defines a entry point
    in main.cpp

    Something like


    in Main.cpp
    RunApp(MyObj());

    However, the RunApp needs to...
  5. Replies
    3
    Views
    1,864

    class contains its self pointer

    Hi
    i want to ask is it normal when I intended to design a class Hierarchy like following?


    class Base {
    ...
    };

    class Manager: public Base {
    ...
  6. Replies
    8
    Views
    1,659

    Well, forget aout above codes. I try to use...

    Well, forget aout above codes.
    I try to use small compilable case to test, and it works.
    Now my question is that.
    If it works, why?
    in copy constructor the arguments const Type& rhs
    why can we...
  7. Replies
    8
    Views
    1,659

    here's the code 22 Interval(const...

    here's the code


    22 Interval(const Interval& rhs) {
    23 _min = rhs._min;
    24 _max = rhs._max;
    25 }

    26 Interval& operator= (const Interval& rhs) {
    27 _min =...
  8. Replies
    8
    Views
    1,659

    Confused about copy constructor...

    Hi,
    I need help about copy constructor


    class A {
    public:
    ...
    A(const A& rhs) {_n1 = rhs._n1; _n2 = rhs._n2;}
    private:
    int _n1;
  9. Thread: about seekg

    by ovid
    Replies
    0
    Views
    1,105

    about seekg

    Hello Everyone, I have a question about using seekg to set position of getpointer.
    I want to parse a file and construct a network using 2 pass parsing.
    There are some lines in the beginning that I...
  10. Replies
    3
    Views
    1,603

    How to co-work in programming?

    Hi, there. I have question about how to co-work with others?
    I am just a newbie. And I have only very limited programming experience.
    I don't have any experience how to co-work with others.
    Can...
  11. Replies
    10
    Views
    1,287

    Thx a lot ... I think I get it

    Thx a lot ... I think I get it
  12. Replies
    10
    Views
    1,287

    Oops. Sorry I am not native speaker. I have...

    Oops. Sorry I am not native speaker. I have trouble understanding what you just reply..
    I thought You approve me with some implementations in the base class, right? Are you just giving a situation...
  13. Replies
    10
    Views
    1,287

    I don't get what you mean here. does the function...

    I don't get what you mean here. does the function mean the client code?
  14. Replies
    10
    Views
    1,287

    Thx for you opinion. He tries to convince me...

    Thx for you opinion.
    He tries to convince me that we should design a pure interface instead of a abstract class with some default implementation and member. And Implement all the codes in the...
  15. Replies
    10
    Views
    1,287

    Question about designing a abstract class

    Hi guys, this is a question about design pattern.
    I wanna ask if I have a I have base class A, and derived class B, C, D.
    And class A is a abstract class, but all of the instance of B , C, D have...
  16. Replies
    4
    Views
    5,063

    Any advice would much be appreciated. Thx ...

    Any advice would much be appreciated. Thx

    Actually I got one another similar FSM question.
    That is if it is to model elevator simulator.

    Normally, should I model state as direction such as...
  17. Replies
    4
    Views
    5,063

    Thx for reply. Maybe I should ask this way....

    Thx for reply.

    Maybe I should ask this way. For this kind of problem, if I need to let the executable binary works like a traffic light simulator. Is it like when I execute the program, it will...
  18. Replies
    4
    Views
    5,063

    About Traffic light controller.

    Hi everyone. I need help. Actually this is one of my homework assignment. It says we need to design a traffic light controller using both software and hardware language. I am not here looking for...
  19. Thread: About typeid..

    by ovid
    Replies
    11
    Views
    2,583

    What I want is like following #include...

    What I want is like following


    #include <iostream>
    #include <typeinfo>
    #include <string>

    struct AType {};

    int main()
  20. Thread: About typeid..

    by ovid
    Replies
    11
    Views
    2,583

    Actually maybe I think it's not I want. What I...

    Actually maybe I think it's not I want.
    What I have a list of string is only class Type "Name". Not real instance..
    I don't think it can work using dynamic_cast.

    I know typeid can directly...
  21. Thread: About typeid..

    by ovid
    Replies
    11
    Views
    2,583

    About typeid..

    Hi, could anyone help me how to using typeid correctly.
    I know it take class type or expression as argument.
    My question is if I have a class TypeA

    The normal usage is typeid(TypeA);
    If I have...
  22. Replies
    5
    Views
    1,394

    Thx for reply. this is the situation where you...

    Thx for reply.
    this is the situation where you will need to use void pointers or templates..
    I don't quite get it.
    The class I design I did think they have somewhat "has-A" relationship in it....
  23. Replies
    5
    Views
    1,394

    Question about design class..

    Hi, I have a question about how to design a class.
    I am really confused about how objects interact with others.
    I know most of the syntax of c++, polymorphism, inhertiance, template as well.
    But...
  24. Replies
    1
    Views
    3,174

    Command line how to handle optional command.

    Hi guys, I am trying to write a simple command line parser.
    My question is what is the better way to handle optional command.
    for example
    like shell command in linux
    (1)ls -a -l
    (2)ls -l
    (3)ls...
  25. Replies
    1
    Views
    1,499

    How to model a system?

    Hello, everyone.
    I have a question about how to use programming to model a system which contain time for mation or something like that.
    To be more specific, the system is like Railway...
Results 1 to 25 of 32
Page 1 of 2 1 2