The vector encapsulated in a structure
Typedef struct {
Vector
Void fun1 (OutputPara & amp; The output);
Vector
The output. The id1=...//refer to id1
The output. Id2=...//refer to id2
Fun1 (output);
Whether can use reference for operation, please? If you can't use references, generally this scenario is how to achieve?
Thank you very much!
CodePudding user response:
Can use references, but the reference must be initialized when definition, reference can't be empty, the reference cannot be modified, that is best after binding can no longer be bound to the other variables,So in general will be inside the constructor initializes, and a reference is an alias, so consider it refers to the object's lifetime,
Above all, set a class member for reference, rarely,