write buffer rejecting two bytes in file

Hello!
I have question that i want to write buffer of size 1470 bytes in file but condition is that it should reject first two bytes and write remaining 1468 bytes to file.How done this??


Last edited on
Hi there,

Assuming your buffer is a char-array:

1
2
3
4
5
6
7
8
#include <iterator>
#include <algorithm>

char buffer[1470];
std::ofstream file("yourfile.txt");

std::ostream_iterator<char> ostr_it(file);
std::copy(buffer+2, buffer+1469, ostr_it);


All the best,
NwN
Thanks!!
Topic archived. No new replies allowed.