EASY SIGABRT TO DEBUG

However, this may seem to be an easy question but I would still like to know about the working and reason of the SIGBART error in this


[1].

The lines 

    if(pos==0)
    	res=str;

are probably the reason for the same. What is the way of how one string is assigned to another?  Is it just a pointer assignment(which I think is not) or the contents of str are copied to res? If the latter is true then why there seems to be a problem with res responsible for error.

Confused!!


  [1]: http://www.codechef.com/viewsolution/4569399