The following code compiles fine but when I try to run the program an illegal operation message comes up. Does anybody know what the problem is, please email me at [email protected].
Printable View
The following code compiles fine but when I try to run the program an illegal operation message comes up. Does anybody know what the problem is, please email me at [email protected].
You need to declare some space for frst_strg and scnd_strg before you use them. Basically they don't point anywhere.
// before the first while loop
frst_strg = new char[strlen(s) + 1];
scnd_strg = new char[strlen(s) + 1];
// before the getch
delete [] frst_strg;
delete [] scnd_strg;
Also, use
#include <iostream>
#include <cstdlib>
#include <cstdio>
#include <conio.h>
using namespace std;
You don't need cstring.h as you are not doing any string manipulation.
Thanks very much, your help is really appreciated.