R
Radith
HI all;
I have created a program just to get an understanding of strcpy. (still an
amateur developer).
I use scanf("%s", &first) in order to get the input to the variable first
(which is char first[]).
Then I go strcpy(second, first). This is just to demonstrate the strcpy
function for myself and it (as far as I know) copies what's in first to
second.
The problem is: * When a user uses spaces in his/her input (e.g. "Hello
World")
--> Only "Hello" will be displayed.
Now I have made sure the array has ample size; I just dont know what's
wrong?
I unfortunately have deleted the source code by mistake (as I was
frustrated); so I can't supply it here; If y'all really need it I wouldn't
ming writing it out again but I think y'all can have a pretty good
understanding from my descriptions.
Please Help. Thanks a lot for it in advance.
I have created a program just to get an understanding of strcpy. (still an
amateur developer).
I use scanf("%s", &first) in order to get the input to the variable first
(which is char first[]).
Then I go strcpy(second, first). This is just to demonstrate the strcpy
function for myself and it (as far as I know) copies what's in first to
second.
The problem is: * When a user uses spaces in his/her input (e.g. "Hello
World")
--> Only "Hello" will be displayed.
Now I have made sure the array has ample size; I just dont know what's
wrong?
I unfortunately have deleted the source code by mistake (as I was
frustrated); so I can't supply it here; If y'all really need it I wouldn't
ming writing it out again but I think y'all can have a pretty good
understanding from my descriptions.
Please Help. Thanks a lot for it in advance.