• C

ÌÌÌÌÌÌÌÌÌÌ characters in string C programming

I am maintaining some old C programs using BTrieve databases.  When I move the contents of a database field into a string, it is padded with  ÌÌÌÌÌÌÌÌÌÌ characters at the end of the string.  What are these and how can I get rid of them.  I am moving the 50 character database field to a string array of 51 characters using the strncpy command.
strncpy(strLongName, MhfsHdr.LongName, 50);
trim(strLongName);
strcpy(CompanyName, strLongName);

Open in new window

pwigintonAsked:
Who is Participating?
 
Infinity08Connect With a Mentor Commented:
The idea is to retrieve the length of the field, and then :

        strLongName[length] = '\0';

to terminate the string.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.