Question
Hello,
I have a question about the codegen_generate_move_struct function, why did you use the off_t type instead of the usual int ot size_t.
Also, it gives me an error, it says type not defined
Thanks
Hello,
I have a question about the codegen_generate_move_struct function, why did you use the off_t type instead of the usual int ot size_t.
Also, it gives me an error, it says type not defined
Thanks
Hello,
I found a fix by importing sys/types.h but there is another defintion for off_t in stdio.h, I wanted to ask if this is a valid solve or not.
off_t should work after youve included the header file. I am guessing you probably missed it in the video content but not to worry its an easy fix as youve seen. Regarding your question about off_t we use it because we refer to an offset not a size and this type is made for offsets. At a low level realistically they are all just numbers but the type helps provide some clarity to a programmer who might see this function prototype.
The way you have included the file is okay. The type is not defined in the C standard so it will be different for some people depending on the setup they are using.
Though I always advise the course is followed on Ubuntu to ensure you dont run into avoidable problems