Just load a text file in memory block

I have created a unsigned short TXTBuffer[65000]
I want to put there an existing text file.
Need soome code to do this
Thanks all of you
Regards
Molocas
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#include <fstream>
#include <iterator>
#include <algorithm>
#include <iostream>
#include <list>

typedef int Data;
typedef std::list < Data > DataList;

int main()
{
    DataList data((std::istream_iterator < DataList::value_type > (std::ifstream("data.txt"))),
        std::istream_iterator < DataList::value_type > ());

    return 0;
}

data.txt file has only numbers.
Topic archived. No new replies allowed.