uncleVic:
Method CString::Copy(string& copy) copies the string member to a string parameter.
Method CString::Assign(string& copy) copies the string parameter to a string member.
Dear uncleVic,
You are spot-on on this! Thank you for the enlightenment!
Should have read the CString class in detail and used Assign instead of Copy.
The conventions could be confusing.
e.g: Assign/Copy vs Getter / Setter
I think it will be great if there is a similar practice for mql5 and java and c++.
Thanks!
You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
Hi!
I recently make a class inherited from CString.
Noticed that there is a copy string error.
Hope this will be help to you too!
// do not use void CString::Copy(string& copy) const -> It simply can't copy then.
void CString::Copy(string& copy)
{
// copy=m_string; // I suspect this is a coding error here.
m_string = copy;
}