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

Posted on 2008-11-14
Last Modified: 2012-06-27
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);


strcpy(CompanyName, strLongName);

Open in new window

Question by:pwiginton
    1 Comment
    LVL 53

    Accepted Solution

    The idea is to retrieve the length of the field, and then :

            strLongName[length] = '\0';

    to terminate the string.

    Featured Post

    6 Surprising Benefits of Threat Intelligence

    All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

    Join & Write a Comment

    Windows programmers of the C/C++ variety, how many of you realise that since Window 9x Microsoft has been lying to you about what constitutes Unicode ( They will have you believe that Unicode requires you to use…
    This is a short and sweet, but (hopefully) to the point article. There seems to be some fundamental misunderstanding about the function prototype for the "main" function in C and C++, more specifically what type this function should return. I see so…
    The goal of this video is to provide viewers with basic examples to understand recursion in the C programming language.
    Video by: Grant
    The goal of this video is to provide viewers with basic examples to understand and use while-loops in the C programming language.

    732 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    23 Experts available now in Live!

    Get 1:1 Help Now