breaking an string of integers

so I'm trying to split a string of integers in parts.
I will input a string of integers containing 25 digits and I have to break it into different strings of 5 digits each. How will I go about this problem?
1
2
3
4
5
6
7
8
9
10
11
12
#include <iostream>
#include <string>
#include <array>

int main()
{
    std::string digits = "1234509876543216789010293";
    std::string strings[] = {{digits, 0,  5}, {digits, 5,  5}, {digits, 10, 5},
                             {digits, 15, 5}, {digits, 20, 5}};
    for(const auto& s: strings)
        std::cout << s << std::endl;
}
http://ideone.com/ZQGDb0
Topic archived. No new replies allowed.