Jump to content

Reading a binary File


wasim6691

Recommended Posts

Yes, you can use C's fread() function for this purpose. However, you should not use malloc()/free() to handle allocation/deallocation of your buffers. Instead, use C++'s new/delete operators or even better a suitable standard container such as std::array<T, N> or std::vector<T>. C++'s <iostream> library also offers you the possibility to read/write binary data from/to files.

SystemC is a C++ library. Therefore, I suggest that you get familiar with C++ first. Confer, e.g., to:

https://isocpp.org/get-started

http://www.cplusplus.com/reference/iolibrary/

https://stackoverflow.com/questions/8798127/binary-input-output-in-c

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...