Failure after failure after...
For those of you who don't know I have been working on this damned file comparator for a little over a week now, and it's been driving me insane. I didn't want to ask for help, but I've run up shit creek. It all come down to this one part. I've narrowed the entire problem down to this one infernal line of code:
Look at that it seems so damned easy right? All it's supposed to do is split up the entered text and add the strings to an array.
But every damned time I try to mess with this the thing blows up in my face. The part I highlighted in red is where everything Blows up. I can't figure out why o_O?
Here's the output:

I am so confused -_-
PS: At BA. I know you showed me one way to do it, but I want to understand how to do it this way before I try to do it the easy way.
Code:
#include <iostream>
#include <fstream>
using namespace std;
int CompareFiles(fstream &file1, fstream &file2);
int main()
{
char* file[2] = {"",""};
char files[50] = "";
// Starting message
cout << "Enter: File1,File2\n";
cin >> files;
//Print what was entered
cout << endl <<files << endl;
// Will try to parse the text into different files
int p = 0;
for(int i = 0; files[i]; i++)
{
if(files[i]!=',')
{
file[p]+=files[i]; // Right here!
cout << file[p] << endl;
}
// The first file should print here
else {p++; cout << "This should be were the first is: " << file[p-1] <<endl;}
}
cout << file[0] << " " << file[1];
system("pause");
return 0;
}
But every damned time I try to mess with this the thing blows up in my face. The part I highlighted in red is where everything Blows up. I can't figure out why o_O?
Here's the output:

I am so confused -_-
PS: At BA. I know you showed me one way to do it, but I want to understand how to do it this way before I try to do it the easy way.
