struct c_struct {
char name [10]
int amount;
}
01 c-struct.
02 name pic x(10).
02 filler pic x(2).
02 amount pic s9(9) comp-5.
union rec {
int i;
char a [4];
double d
}
01 rec.
02 i pic s9(9) comp-5.
02 a pic x(4) redefines i.
02 d comp-1 redefines i.
char * x;
char y[10] = "hello";
x = strdup(y);
78 c-null value x"00".
01 y pic x(9) value "hello" & c-null.
01 x pointer.
…
procedure division.
…
call "strdup" using
by reference y,
returning x.
I am curious if you are trying to develop expertise in this area what is the best way to go? I am mostly a hobbyist programmer at the moment and I am curious how best to learn how to apply the language to complex problems. C++ to me seems to be a rather complex language and I do not as of yet fully understand the runtime model of the language and how it maps to the machine. I have tried reading some books on the subject but I am not sure if they are particularly good ones (like Modern C++ design, Exceptional C++ and More Exceptional C++). Modern C++ Design doesnt for example give a full description of the rational behind some of the design decisions made and how those conclusions were reached there are also a number of claims in the book (I am sure the author is correct but I am curious how he reached his conclusions) which I am not sure how to verify. I.e. that standard heap allocators are not very efficient for managing small memory chunks.
My thoughts here were perhaps to study the STL library code or other libraries such as Loki but I was curious if there may be faster or quicker methods.
Thanks in advance.