Problem p02420 (C++) — buggy submission, verdict: Runtime Error

#include <cstring>
#include <iostream>
#include <list>
#include <string>
#include <vector>

typedef struct _ORDER {
  char data[201]; // max of string.
  int effect_count;
  int shuffle_number[100]; // max of shuffle number is 100.
} ORDER;

class Shuffle {
  std::vector<ORDER> lst;
  std::list<char> shuffle_data;

public:
  bool run(void); // execute shuffle operation.

private:
  void read(void);
  void shuffle(void);
  void disp();
};

bool Shuffle::run() {
  read();
  if (0 >= lst.size()) {
    return false;
  }
  shuffle();
  return true;
}

void Shuffle::read(void) {
  ORDER tmp;
  std::string line;
  while (true) {
    std::memset(&tmp, 0, sizeof(tmp));
    std::cin >> line;
    if (0 == std::strcmp("-", line.c_str())) {
      break;
    }
    std::memcpy(tmp.data, line.c_str(), sizeof(tmp.data));
    std::cin >> tmp.effect_count;
    for (int i = 0; i < tmp.effect_count; i++) {
      std::cin >> tmp.shuffle_number[i];
    }
    lst.push_back(tmp);
  }
}

void Shuffle::shuffle() {
  for (std::vector<ORDER>::const_iterator it = lst.begin(); it != lst.end();
       it++) {
    int index = 0;
    shuffle_data.clear();
    while ('\\0' != it->data[index]) {
      shuffle_data.push_back(it->data[index++]);
    }
    for (int i = 0; i < it->effect_count; i++) {
      for (int j = 0; j < it->shuffle_number[i]; j++) {
        char t = shuffle_data.front();
        shuffle_data.pop_front();
        shuffle_data.push_back(t);
      }
    }
    disp();
  }
}

void Shuffle::disp() {
  for (std::list<char>::const_iterator it = shuffle_data.begin();
       it != shuffle_data.end(); it++) {
    std::cout << *it;
  }
  std::cout << std::endl;
}

int main() {
  Shuffle shuffle;
  (void)shuffle.run();
}

Error: -7

Fixed submission:

#include <iostream>
#include <string>

typedef struct _card {
  std::string alpha;
  unsigned int shuffle_count;
  unsigned int h[10];
} card_t;

typedef struct _card_list {
  card_t data_set[10];
  unsigned int effect_count;
} card_list_t;

static bool Input(card_list_t &t) {
  if (0x00 == &t) {
    return false;
  }

  while (true) {
    std::cin >> t.data_set[t.effect_count].alpha;
    if (200 < t.data_set[t.effect_count].alpha.size()) {
      return false;
    }

    if (0 == t.data_set[t.effect_count].alpha.compare("-")) {
      break;
    }

    std::cin >> t.data_set[t.effect_count].shuffle_count;
    for (unsigned int i = 0; i < t.data_set[t.effect_count].shuffle_count;
         i++) {
      std::cin >> t.data_set[t.effect_count].h[i];
    }

    t.effect_count++;
  }

  return true;
}

static bool Shuffle(card_list_t &t) {
  std::string tmp;

  if (0x00 == &t) {
    return false;
  }

  for (unsigned int i = 0; i < t.effect_count; i++) {
    for (unsigned int j = 0; j < t.data_set[i].shuffle_count; j++) {
      tmp = t.data_set[i].alpha.substr(0, t.data_set[i].h[j]);
      t.data_set[i].alpha.erase(0, t.data_set[i].h[j]);
      t.data_set[i].alpha += tmp;
    }
  }

  return true;
}

int main() {
  card_list_t data_list;

  if (true == Input(data_list)) {
    (void)Shuffle(data_list);
    for (unsigned int i = 0; i < data_list.effect_count; i++) {
      std::cout << data_list.data_set[i].alpha << std::endl;
    }
  }

  return (0);
}