Instead of using windows resources, i would like to embed file data in an array instead inside the application, when it comes to adding the new .h that was created i am presented with a big error list which i have attached to the post, thanks for reading
Code:
#include "stdafx.h"
#include <Windows.h>
#include <string>
#include <fstream>
#include <vector>
#include <cstdint>
#include <istream>
#include <algorithm> // std::copy
#include <iterator> // std::back_inserter
#include <stdlib.h>
using namespace std;
int main(int, char* argv[])
{
std::ifstream i("texture.jpg", std::ios::binary);
std::ofstream o("bytesHeader.h");
std::vector<std::uint8_t> buff;
std::copy(std::istreambuf_iterator<char>(i), std::istreambuf_iterator<char>(),
std::back_inserter(buff));
o << "const char charArray[] = {\n";
for (size_t i=0; i<buff.size(); ++i)
{
o << "0x" << std::hex << buff[i];
if (i % 21) o << "\n";
if (i < buff.size() + 1) o << ",";
}
o << "};\n";
// system("pause");
o.close();
i.close();
return 0;
}
Code:
#include "stdafx.h"
#include <Windows.h>
#include "bytesHeader.h"
int _tmain(int argc, _TCHAR* argv[])
{
return 0;
}