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...
Type: Posts; User: ovid
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...
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. ...
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...
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...
Hi
i want to ask is it normal when I intended to design a class Hierarchy like following?
class Base {
...
};
class Manager: public Base {
...
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...
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 =...
Hi,
I need help about copy constructor
class A {
public:
...
A(const A& rhs) {_n1 = rhs._n1; _n2 = rhs._n2;}
private:
int _n1;
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...
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...
Thx a lot ... I think I get it
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...
I don't get what you mean here. does the function mean the client code?
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...
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...
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...
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...
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...
What I want is like following
#include <iostream>
#include <typeinfo>
#include <string>
struct AType {};
int main()
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...
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...
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....
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...
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...
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...