Go to post number 5.
(If i were you I would do that. It is not such a big deal ;) )
Type: Posts; User: std10093
Go to post number 5.
(If i were you I would do that. It is not such a big deal ;) )
Maybe this is better.
length + 1 was meant for the terminating null. You have to remember this for your dynamic allocation too!
I provided you two options... Not one :)
If you interesting read here for the gcc
Salem explained the problem, but you posted the same time so I guess you didn't notice it :)
You have to dynamically allocate your memory, or set from start a constant number that is logical for...
You have have
char input[] = "";
so automatically, the length is computed by the compiler to preserve enough space to fit what is assigned to it, thus ""
What you need is
char...