How to read text file in C++ with 4 character?
<p>I have following text file.</p>

<pre><code>aaaaBBBBccccDDDDKKK
EEEEPPPPMMMMssssPPPP
AAAAEEEE
AAAAEEE
DDDDCCCC
</code></pre>

<p>And I have to read text file in c++ with divide four character.</p>

<p>and I want insert  the four length character into string in one array.</p>

<p>For example,
aaaa, BBBB cccc, DDDD, kkk, each word divided into array.
string WordArray[N][M]</p>

<pre><code>WordArray[0][0] = "aaaa";
WordArray[0][1] = "BBBB";
WordArray[0][2] = "cccc";
WordArray[0][3] = "DDDD";
WordArray[0][4] = "KKK";

WordArray[1][0] = "EEEE";
WordArray[1][1] = "PPPP";
WordArray[1][2] = "MMMM";
WordArray[1][3] = "ssss";
WordArray[1][4] = "PPPP";
.
.
.

WordArray[4][0] = "DDDD";
WordArray[4][1] = "CCCC";
</code></pre>

<p>How can I read text in upper way?</p>

<p>I want to use <code>&lt;fstream&gt;</code>.</p>