Thread: returning long uint8_t char string

  1. #1
    Registered User
    Join Date
    Mar 2015
    Posts
    1

    returning long uint8_t char string

    After processeing and extracting infor, I got a char string in uinn8_t form. When I pass the pointer containing this string, e.g. by grtting the returned value of the function, i can only get the first 8 char. the problem still persists even aft I tried other methods. e.g.1 change return type from uint8_t * to uint32_t *. eg2. use typdee struct to split the string into 3 uint8_t *. Hope to seek any help or guidance. thanks!

  2. #2
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    39,661
    Perhaps you should post your code.

    Are you trying to return a pointer to a local array by any chance (note: you can't do this)?
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. How to convert char array of 64 bytes to long long int
    By pkumarn in forum C Programming
    Replies: 19
    Last Post: 03-06-2012, 02:23 AM
  2. Returning const char*/ std::string.c_str()
    By bengreenwood in forum C++ Programming
    Replies: 9
    Last Post: 10-28-2009, 05:53 PM
  3. Returning string from char *function()
    By Skvr in forum C Programming
    Replies: 3
    Last Post: 07-26-2009, 12:36 PM
  4. Returning a string as a char*... Help!
    By smarttart62 in forum C Programming
    Replies: 25
    Last Post: 10-09-2006, 07:02 PM
  5. char string to long conversion
    By rastan in forum C Programming
    Replies: 10
    Last Post: 11-06-2003, 07:28 PM

Tags for this Thread