Results 1 to 5 of 5

Thread: Real length of a char string?

Threaded View

  1. #1

    Thread Starter
    Member
    Join Date
    Apr 2008
    Posts
    42

    Real length of a char string?

    The length of a character string is usually identified by the first null byte. But what if you had read a binary file? Files are filled with null bytes. I know fread returns the amount of bytes read, but is there another way?

    So strlen("123456") returns 6;

    strlen("123456\07"), that is 1,2,3,4,5,6,NULLBYTE,7, and that returns 6. Any otehr way?
    Last edited by hellowonn; Jul 20th, 2008 at 08:46 AM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width