Reading a file and storing the contents in an array
Some comments:


Use std::vector instead of an inflexible array.  You're writing in C++, so you really ought to use the power of that language to write better code.
Don't use memset.  It's generally wise to avoid mixing old-style C library functions such as memset, malloc and so forth, with C++.  Strange things can happen and there's usually a better C++ way to do things without those.
Instead of using string.find, consider using other techniques such as the ones described here to split a line into its constituent pieces.
Rather than printing an error message, throw an exception.  That way your code can be reused in situtations in which std::cout is not present or not visible.
Do NOT embed using namespace std; into code like that!  It's extremely bad practice


EDIT:
Here's a quick alternative using a variation of the string split I pointed to in point #3.

#include &lt;iostream&gt;
#include &lt;fstream&gt;
#include &lt;string&gt;
#include &lt;vector&gt;

template &lt;typename Container&gt;
Container&amp; split(Container&amp; result,
  const typename Container::value_type&amp; s,
  const typename Container::value_type&amp; delimiters)
{
  result.clear();
  size_t current;
  size_t next = -1;
  do {
    current = next + 1;
    next = s.find_first_of( delimiters, current );
    result.push_back( s.substr( current, next - current ) );
  } while (next != Container::value_type::npos);
  return result;
}

int main(int argc, char *argv[])
{
    if (argc &lt; 2) {
        std::cout &lt;&lt; "Usage readarray filename\n";
        return 0;
    }
    const std::string delimiter{","};
    std::vector&lt;std::vector&lt;std::string&gt; &gt; v;
    // fetch the file into v
    std::string line;
    std::vector&lt;std::string&gt; fields;
    for( std::ifstream in(argv[1]); std::getline(in, line); ) {
        v.push_back(split(fields, line, delimiter));
    }
    // now print the results
    for (const auto &amp;i : v) {
        for (const auto &amp;j: i)
            std::cout &lt;&lt; "[" &lt;&lt; j &lt;&lt; "]";
        std::cout &lt;&lt; '\n';
    }
}


This uses C++11, but could easily be adapted for old compilers.  Based on this input file:

alpha,frank,ruby,diamond
beta,joseph,emerald,circle
gamma,may,onyx,triangle


The code produces this output:

[alpha][frank][ruby][diamond]
[beta][joseph][emerald][circle]
[gamma][may][onyx][triangle]