Does unnessesary and dangerous c-style cast.
you can simply write: char * abc = "1ns";
But any attempt to change abc sting value like abc = 'T'; will lead to segfault.
Best variant: constchar * abc = "1ns";: it is safe and syntaxically correct.
(char*)something is a c-style cast. In C++ you should use static_cast<char*>(something)
strcopy() works fine when you are using it for initial variable ititialization. Beacause you know in advance both array and literal constant size. My code with it was just an example of what that code equivalent to.
1) We are declaring data variable points to as const. You still can change where pointer is point to.
2) Sorry, my bad. Drop the const: char abc = "1ns";