Why does this C++ code result in a segmentation fault?
- by user69514
I keep getting a segmentation fault when the readAuthor() method is called. Does anybody know why this happens? I am supposed to use dynamic arrays, I know this would be so easy if I was using static array.
#include <iostream>
#include <string>
#include <cstring>
#include <cstdlib>
using namespace std;
/** declare arrays…