Results 1 to 4 of 4

Thread: how can i use unsigned char in certain functions?

  1. #1

    Thread Starter
    Banned jhermiz's Avatar
    Join Date
    Jun 2002
    Location
    Antarctica
    Posts
    2,492
    Did you try casting ?

  2. #2
    Fanatic Member twanvl's Avatar
    Join Date
    Dec 2001
    Posts
    771
    You shouldn't use str* functions here. Those functions are for strings, and that's not what you're using here. You should keep the length of the array yourself (in an int), and copy using memcpy.

  3. #3
    New Member
    Join Date
    Jun 2002
    Posts
    10
    ye now i use memcpy to copy, but im usiing getline to get the data. so i dont know the length.

    so how can i get the length? also the send() function for winsock wont take a unsigned char. and if i type cast wont it make all the chars with a value over 127 negative?

  4. #4
    Monday Morning Lunatic parksie's Avatar
    Join Date
    Mar 2000
    Location
    Mashin' on the motorway
    Posts
    8,169
    If it's binary, don't use getline. Use read instead.
    I refuse to tie my hands behind my back and hear somebody say "Bend Over, Boy, Because You Have It Coming To You".
    -- Linus Torvalds

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