Hello,
I dont get any errors while compiling, but after entering the first text i get "This program has encountered an error and must be closed", prompting me to send an error report per usual, and i have absolutely no clue about what might be wrong, the only thing i could think of would be the size_t operator,
Here comes the code:
It looks like it is because you haven't assigned size/value/whatever output...so since the pointer is undefined, you will get undefined behavior when you try to access it as an array.
noticed it now, so i added int size_of_input, size_of_key;
but it still doesnt work, however, when i tried to change the char* input;
to char input[255];
everything worked as expected, but the size of was returned at 255, which means that a lot of non-sense text was typed out as well, which was the reason to me wanting to use dynamic memory allocation, but doesnt the sizeof work on dynamic memory?
EDIT:: Problem Solved; I made a compromise; in short:
1 2 3 4 5 6 7 8
char input[255];
char key[255];
//and after the program recives the input
char* dynInput=input;
char* dynKey=key;
size_t size_of_input = sizeof dynInput+1;
size_t size_of_key = sizeof dynKey+1;