Thread: Removing first element in uint8_t array

  1. #1
    Registered User
    Join Date
    Oct 2021
    Posts
    7

    Removing first element in uint8_t array

    Hello, I am trying to run the function which generates the result without the first element from source array. However after running the code 4 elements are removed instead of 1. What I am doing wrong, can you folks help me please.

    Below the picture with code.

    Removing first element in uint8_t array-remove_first_element-jpg

  2. #2
    Registered User
    Join Date
    May 2012
    Location
    Arizona, USA
    Posts
    948
    Both of the arguments are pointers to pointer to uint8_t (i.e., double pointer). With 32-bit pointers, that would removes 4 bytes (and overwrite 96 bytes after the no_element array). You want pointer to uint8_t (i.e., single pointer). Basically, remove the stars.

  3. #3
    Registered User
    Join Date
    Oct 2021
    Posts
    7
    Quote Originally Posted by christop View Post
    Both of the arguments are pointers to pointer to uint8_t (i.e., double pointer). With 32-bit pointers, that would removes 4 bytes (and overwrite 96 bytes after the no_element array). You want pointer to uint8_t (i.e., single pointer). Basically, remove the stars.
    Thank you very much for your help. It works. Hurray !!!

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Help with removing element from an array
    By shaddock in forum C Programming
    Replies: 3
    Last Post: 07-18-2015, 09:13 AM
  2. removing an element from an array
    By synhyborex in forum C Programming
    Replies: 7
    Last Post: 03-10-2011, 05:33 AM
  3. Removing an array in an element?
    By bluej322 in forum C Programming
    Replies: 4
    Last Post: 02-19-2011, 11:36 PM
  4. Removing element from vector?
    By jw232 in forum C++ Programming
    Replies: 5
    Last Post: 02-04-2008, 02:54 AM
  5. Segfault when removing element from list
    By jmd15 in forum C++ Programming
    Replies: 4
    Last Post: 04-05-2007, 12:25 PM

Tags for this Thread