binary data in string

This is a discussion on binary data in string within the C Programming forums, part of the General Programming Boards category; i've been browsing through the MySQL C API reference and found that query strings may contain binary data such as ...

  1. #1
    Registered User trekker's Avatar
    Join Date
    Mar 2002
    Posts
    46

    binary data in string

    i've been browsing through the MySQL C API reference
    and found that query strings may contain binary data such as
    the '\0' and may cause erroneous results from functions like
    strlen().

    Any idea of such a string ?

    thanks
    to boldy code where...

  2. #2
    ATH0 quzah's Avatar
    Join Date
    Oct 2001
    Posts
    14,826

    Re: binary data in string

    Originally posted by trekker
    i've been browsing through the MySQL C API reference
    and found that query strings may contain binary data such as
    the '\0' and may cause erroneous results from functions like
    strlen().

    Any idea of such a string ?

    thanks
    Yeah, anything binary like they've stated. IE: Don't store graphics or what not. Only use text. Otherwise, if any byte in your data is zero, you'll not be able to use standard string functions on it.

    This is just basic common sense. You don't use standard string functions on data that is considered "binary". (IE: not text)

    Quzah.
    Hope is the first step on the road to disappointment.

  3. #3
    Registered User trekker's Avatar
    Join Date
    Mar 2002
    Posts
    46
    ...so normal strings do have any possibility of causing an error
    since the only zero byte in the ASCII table is the terminating null
    char.

    tnx
    to boldy code where...

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 11
    Last Post: 06-16-2011, 11:59 AM
  2. xor linked list
    By adramalech in forum C Programming
    Replies: 23
    Last Post: 10-14-2008, 10:13 AM
  3. OOP Question DB Access Wrapper Classes
    By digioz in forum C# Programming
    Replies: 2
    Last Post: 09-07-2008, 04:30 PM
  4. C++ ini file reader problems
    By guitarist809 in forum C++ Programming
    Replies: 7
    Last Post: 09-04-2008, 06:02 AM
  5. Classes inheretance problem...
    By NANO in forum C++ Programming
    Replies: 12
    Last Post: 12-09-2002, 02:23 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21