Im sorry, couldn't find the edit button here are the compile errors, and where they occur.

Error: '!=' : no conversion from 'char *' to 'int'
Error: '!=' : 'int' differs in levels of indirection from 'char [2]'
Code:
{ if(pid[i] != "-");
Error: 'strcat' : cannot convert parameter 2 from 'char' to 'const char *'
Code:
  strcat(newpid, pid[i]);

Thanks in advance,