I am a complete novice in C, but I have been assigned for the work to understand the C code. Can anyone help understand the following code?
memcpy (out, &field_id, sizeof(field_id));
Here are the datatypes of field_id and out:
char* out = *out_ptr;
short field_id = column->column_index;
As far as I can understand the command is copying sizeof(field_id)
number of characters from &field
into out pointer. But this does not make any sense to me. Also, as far as I know C is not an OOP language, how come we are using something like column->column_index
which seems like we are trying to access column_index
property of some object named column
.
I have advanced programming experience in Java, Python, C# so I can understand even if you don't go in much details, only hints or links to helpful articles will also do.