Coder's Guild Mailing List

Re: Concatenate strings

Posted by Hal Bonnin on 2000-05-25

heres how i did it

for(int i=0;i<DATASIZE;i++)
{
      if(strcmp(type,"bulky")==0)
      {
        float tempnumber(0);
        sscanf(typedata,"%f",&tempnumber);
        tempbulkycharges+=atoi(number)*tempnumber;

if((strlen(TempBulkyNames)+strlen(name))<(BODYLENGTH-5)&&(atoi(number)>0))
        {
          if(strlen(TempBulkyNames)>0)// first name there
          {
            strncat(TempBulkyNames," , ",1);// add comma
          }
          strncat(TempBulkyNames,name,strlen(name));// add name
        }
      }
}