I know next to nothing about C++... but I googled the error and I thought this site might be of help.
/*
Geodata Generator for Lineage 2
*/
#include <iostream.h>
#include <fstream.h>
#include <stdio.h>
int main () {
int MAP_HEIGHT[] = {
//38-3F
(0xE318E318), (0xE46DE46D), (0xE5C2E5C2), (0xE717E717),
(0xE86CE86C), (0xE9C1E9C1), (0xEB16EB16), (0xec6bec6b),
//40-4f
(0xedc0edc0), (0xef15ef15), (0xf06af06a), (0xf1bff1bf),
(0xf314f314), (0xf469f469), (0xf5bef5be), (0xf713f713),
(0xf868f868), (0xf9bdf9bd), (0xfb12fb12), (0xfc67fc67),
(0xfdbcfdbc), (0xff11ff11), (0x00670067), (0x01bc01bc),
//50-5f
(0x03110311), (0x04660466), (0x05bb05bb), (0x07100710),
(0x08650865), (0x09ba09ba), (0x0b0f0b0f), (0x0c640c64),
(0x0db90db9), (0x0f0e0f0e), (0x10631063), (0x11b811b8),
(0x130d130d), (0x14621462), (0x15b715b7), (0x170c170c),
//60-6f
(0x18611861), (0x19b619b6), (0x1b0b1b0b), (0x1c601c60),
(0x1db51db5), (0x1f0a1f0a), (0x205f205f), (0x21b421b4),
(0x23092309), (0x245e245e), (0x25b325b3), (0x27082708),
(0x285d285d), (0x29b229b2), (0x2b072b07), (0x2c5c2c5c),
//70-7f
(0x2db12db1), (0x2f062f06), (0x305b305b), (0x31b031b0),
(0x33053305), (0x345a345a), (0x35af35af), (0x37043704),
(0x38593859), (0x39ae39ae), (0x3b033b03), (0x3c583c58),
(0x3dad3dad), (0x3f023f02), (0x40574057), (0x41ac41ac),
//80-8f
(0x43014301), (0x44564456), (0x45ab45ab), (0x47004700),
(0x48554855), (0x49aa49aa), (0x4aff4aff), (0x4c544c54),
(0x4da94da9), (0x4efe4efe), (0x50535053), (0x51a851a8),
(0x52fd52fd), (0x54525452), (0x55a755a7), (0x56fc56fc),
//90-9f
(0x58515851), (0x59a659a6), (0x5afb5afb), (0x5c505c50),
(0x5da55da5), (0x5efa5efa), (0x604f604f), (0x61a461a4),
(0x62f962f9), (0x644e644e), (0x65a365a3), (0x66f866f8),
(0x684d684d), (0x69a269a2), (0x6af76af7), (0x6c4c6c4c),
//a0-a5
(0x6da16da1), (0x6ef66ef6), (0x704b704b), (0x71a071a0),
(0x72F572F5), (0x744A744A)
};
int RGB[] = {//0x3
(0x38), (0x39), (0x3a), (0x3b), (0x3C), (0x3D), (0x3E), (0x3F),
//0x4
(0x40), (0x41), (0x42), (0x43), (0x44), (0x45), (0x46), (0x47),
(0x48), (0x49), (0x4a), (0x4b), (0x4c), (0x4d), (0x4e), (0x4f),
//0x5
(0x50), (0x51), (0x52), (0x53), (0x54), (0x55), (0x56), (0x57),
(0x58), (0x59), (0x5a), (0x5b), (0x5c), (0x5d), (0x5e), (0x5f),
//0x6
(0x60), (0x61), (0x62), (0x63), (0x64), (0x65), (0x66), (0x67),
(0x68), (0x69), (0x6a), (0x6b), (0x6c), (0x6d), (0x6e), (0x6f),
//0x7
(0x70), (0x71), (0x72), (0x73), (0x74), (0x75), (0x76), (0x77),
(0x78), (0x79), (0x7a), (0x7b), (0x7c), (0x7d), (0x7e), (0x7f),
//0x8
(0x80), (0x81), (0x82), (0x83), (0x84), (0x85), (0x86), (0x87),
(0x88), (0x89), (0x8a), (0x8b), (0x8c), (0x8d), (0x8e), (0x8f),
//0x9
(0x90), (0x91), (0x92), (0x93), (0x94), (0x95), (0x96), (0x97),
(0x98), (0x99), (0x9a), (0x9b), (0x9c), (0x9d), (0x9e), (0x9f),
//0xA
(0xa0), (0xa1), (0xa2), (0xa3), (0xa4), (0xa5)
};
int BREAK = '00';
int MAP_HEAD[] = { 22, 25, 128 };
char MAP_NAME[] = "output_conv.dat";
int HEADER[] = {0x00001000,0x00,0x00000100,0x00000100};
int count = 0,ch;
char BmpFile[256] = "lineage2.bmp";
ifstream fin(BmpFile, ios::binary);
ofstream fout(MAP_NAME, ios::binary);
fout.write ((&MAP_HEAD));
fout.write ((&HEADER));
while (!fin.eof()) {
ch = fin.get();
fin.get();
fin.get();
for (int i = 0; i < 110; i++){
if (ch == RGB[i]){
fout.write ((&BREAK));
fout.write ((&MAP_HEIGHT[i]));
fout.write ((&BREAK));
}
}
}
fout.close();
return 0;
}
so in the ofstream class it becomes:basic_ostream<charT,traits>& write(const char_type* s, streamsize n);
Writes n characters from s. If the output fails after any character, write sets badbit and stops writing. The return value is *this.
/*
Geodata Generator for Lineage 2
*/
#include <iostream>
#include <fstream>
#include <cstdio>
using namespace std;
int main()
{
int MAP_HEIGHT[] = {
//38 - 3 F
(0xE318E318), (0xE46DE46D), (0xE5C2E5C2), (0xE717E717),
(0xE86CE86C), (0xE9C1E9C1), (0xEB16EB16), (0xec6bec6b),
//40 - 4 f
(0xedc0edc0), (0xef15ef15), (0xf06af06a), (0xf1bff1bf),
(0xf314f314), (0xf469f469), (0xf5bef5be), (0xf713f713),
(0xf868f868), (0xf9bdf9bd), (0xfb12fb12), (0xfc67fc67),
(0xfdbcfdbc), (0xff11ff11), (0x00670067), (0x01bc01bc),
//50 - 5 f
(0x03110311), (0x04660466), (0x05bb05bb), (0x07100710),
(0x08650865), (0x09ba09ba), (0x0b0f0b0f), (0x0c640c64),
(0x0db90db9), (0x0f0e0f0e), (0x10631063), (0x11b811b8),
(0x130d130d), (0x14621462), (0x15b715b7), (0x170c170c),
//60 - 6 f
(0x18611861), (0x19b619b6), (0x1b0b1b0b), (0x1c601c60),
(0x1db51db5), (0x1f0a1f0a), (0x205f205f), (0x21b421b4),
(0x23092309), (0x245e245e), (0x25b325b3), (0x27082708),
(0x285d285d), (0x29b229b2), (0x2b072b07), (0x2c5c2c5c),
//70 - 7 f
(0x2db12db1), (0x2f062f06), (0x305b305b), (0x31b031b0),
(0x33053305), (0x345a345a), (0x35af35af), (0x37043704),
(0x38593859), (0x39ae39ae), (0x3b033b03), (0x3c583c58),
(0x3dad3dad), (0x3f023f02), (0x40574057), (0x41ac41ac),
//80 - 8 f
(0x43014301), (0x44564456), (0x45ab45ab), (0x47004700),
(0x48554855), (0x49aa49aa), (0x4aff4aff), (0x4c544c54),
(0x4da94da9), (0x4efe4efe), (0x50535053), (0x51a851a8),
(0x52fd52fd), (0x54525452), (0x55a755a7), (0x56fc56fc),
//90 - 9 f
(0x58515851), (0x59a659a6), (0x5afb5afb), (0x5c505c50),
(0x5da55da5), (0x5efa5efa), (0x604f604f), (0x61a461a4),
(0x62f962f9), (0x644e644e), (0x65a365a3), (0x66f866f8),
(0x684d684d), (0x69a269a2), (0x6af76af7), (0x6c4c6c4c),
//a0 - a5
(0x6da16da1), (0x6ef66ef6), (0x704b704b), (0x71a071a0),
(0x72F572F5), (0x744A744A)
};
int RGB[] = { //0x3
(0x38), (0x39), (0x3a), (0x3b), (0x3C), (0x3D), (0x3E), (0x3F),
//0x4
(0x40), (0x41), (0x42), (0x43), (0x44), (0x45), (0x46), (0x47),
(0x48), (0x49), (0x4a), (0x4b), (0x4c), (0x4d), (0x4e), (0x4f),
//0x5
(0x50), (0x51), (0x52), (0x53), (0x54), (0x55), (0x56), (0x57),
(0x58), (0x59), (0x5a), (0x5b), (0x5c), (0x5d), (0x5e), (0x5f),
//0x6
(0x60), (0x61), (0x62), (0x63), (0x64), (0x65), (0x66), (0x67),
(0x68), (0x69), (0x6a), (0x6b), (0x6c), (0x6d), (0x6e), (0x6f),
//0x7
(0x70), (0x71), (0x72), (0x73), (0x74), (0x75), (0x76), (0x77),
(0x78), (0x79), (0x7a), (0x7b), (0x7c), (0x7d), (0x7e), (0x7f),
//0x8
(0x80), (0x81), (0x82), (0x83), (0x84), (0x85), (0x86), (0x87),
(0x88), (0x89), (0x8a), (0x8b), (0x8c), (0x8d), (0x8e), (0x8f),
//0x9
(0x90), (0x91), (0x92), (0x93), (0x94), (0x95), (0x96), (0x97),
(0x98), (0x99), (0x9a), (0x9b), (0x9c), (0x9d), (0x9e), (0x9f),
//0xA
(0xa0), (0xa1), (0xa2), (0xa3), (0xa4), (0xa5)
};
int BREAK = '0';
int MAP_HEAD[] = { 22, 25, 128 };
char MAP_NAME[] = "output_conv.dat";
int HEADER[] = { 0x00001000, 0x00, 0x00000100, 0x00000100 };
int count = 0, ch;
char BmpFile[256] = "lineage2.bmp";
ifstream fin(BmpFile, ios::binary);
ofstream fout(MAP_NAME, ios::binary);
fout.write((char *)(&MAP_HEAD), sizeof(int)*3);
fout.write((char *)(&HEADER), sizeof(int)*4);
while (!fin.eof()) {
ch = fin.get();
fin.get();
fin.get();
for (int i = 0; i < 110; i++) {
if (ch == RGB[i]) {
fout.write((char *)(&BREAK), sizeof(int));
fout.write((char *)(&MAP_HEIGHT[i]), sizeof(int));
fout.write((char *)(&BREAK), sizeof(int));
}
}
}
fout.close();
return 0;
}