I read the longest from the binary into an unsigned char buffer using fread.
Now I would like to get a long one. How to do it?
unsigned char buffer[sizeof(long)]; fread(buffer, sizeof(long), 1, my_file);
thanks!
Surely you mean:
long buffer; fread(&buffer, sizeof(long), 1, my_file);
Source: https://habr.com/ru/post/1345429/More articles:Optimize model conversion to GLSL for 2D - shaderInstalling Git and Mercurial on the same machine - gitCouchDB App Application - couchdbViM: how to put a string from an input dialog into a list - stringHow are structural members stored on a small destination machine? - cParsing a token list in an expression tree - algorithm"Media not found." How to insert an image in android - androidHow to disable "AllowPrinting" for PDF generated in cfreport / cfdocument? - coldfusionHow to get jQuery, AJAX and servlet working together? - jquerypython omnicompletion in vim not working - pythonAll Articles