A way to read data out of a file at compile time to put it somewhere in application image files to initialize an array

前端 未结 4 1766
我在风中等你
我在风中等你 2021-01-29 03:21

considering visual C++ compiler, Lets say I\'ve got a file with whatever extension and it contains 100 bytes of data which are exactly the data that I want to initialize an arra

4条回答
  •  独厮守ぢ
    2021-01-29 04:08

    You do this with a resource in a Windows program. Right-click the project, Add, Resource, Import. Give the custom resource type a name. Edit the resource ID, if necessary. Get a pointer to the resource data at runtime with FindResource and LoadResource.

提交回复
热议问题