Well, it's not a perfect style because of 4 immediate constants hard-coded. It also consumes 80 bytes of memory without purpose, but this is because of the nature of static array. To me, null terminated string was one of the worst ideas in the history of technology, but this is not your fault :-). You could use
std::string
instead.
The function
strcpy
is unsafe, better use
strcpy_s
.
After the structure declaration you need ';'.
The code will not compile because of
const
before
data
.
Now, may I understand why are you asking such Question if your code does not even compile, and you even did not report this problem? Did you even try to compile it?
It looks like you're trying to put too much of your job on others, but it does not help you much.
I must say, your method of learning is not effective. I advice you stop asking such Questions here at CodeProject and learn the basics using some good manual and exercises, using the approach I outlined here:
I have a problem with my program. Please help![
^].
—SA