the book i began reading taught me to use char* variable; to store strings, this may not be what i'm looking for... if i'm not mistaken when i tried char * ss=new char[]; it didn't work the way a normal pointer did, i'm using dev c++ now, and i need to find another way to do what i'm doing. The segmentation fault is marked with comments, at least that's the point debug told me a segmentation fault occurred...
I know someone else's code can get pretty horrible to look through sometimes, but, any help would be appreciated, please direct me toward a better programming style and such.
of course the access violation occurred when using more than 1 argument.
If you want to return a char *, there are no other alternatives. And don't forget to initialize the array to zero (or at least the first element) before calling strcat().
I mean *store=0; or store[0]=0;
strcat() assumes that the first parameter is a valid C-string, and begins copying the second parameter at strlen(str1).
std::string is the other alternative. I see that you are including C++ headers so why bother using char* at all? Any time that you declare a pointer you have to have a plan for filling the pointer with an address to allocated memory or allocate the memory yourself. You can never pass a null or uninitialized pointer to a c-run time function.