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 1765
我在风中等你
我在风中等你 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:05

    • Write a program that reads the 100 byte data file and generates as output, a file, with c++ code/syntax for declaring an array with the 100 bytes in the file.
    • Include this new generated file(inline) in your main c++ file.
    • Call the c++ compiler on the main c++ file.

提交回复
热议问题