When a scanf("%s",s);
(one of many ways to get a string which is not perfect) encounters a space in the input, it will try to put it in another variable, right? But what hapens if there is only one variable provided as in this case?
Also what other ways are used to input a string? which is the esiest or best one to use and which one does not give problems like the gets(s);
function?
Here is my s_insert
function now:
// pointer to pointer needed when you allocate memory in the function
void s_insert(char **string_one){ //inserts string (loss of original data)
*string_one=(char*)malloc(200);
fgets (*string_one,200,stdin);
}