Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8844699
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T11:33:11+00:00 2026-06-14T11:33:11+00:00

uint8_t *var; var=//something; Now I want to loop through each element of this var

  • 0
uint8_t *var;
var=//something;

Now I want to loop through each element of this var
how to do this
please help

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T11:33:12+00:00Added an answer on June 14, 2026 at 11:33 am

    Make loop like in plain C. uint8_t *var is just an C array.

    for (uint8_t i = 0; i < ARRAY_LENGTH; ++i) {
        var[i] = ...; // Do whatever you want
    }
    

    For example

    uint8_t *v = (uint8_t *)malloc(5 * sizeof(uint8_t));
    
    for (uint8_t i = 0; i < 5; ++i) {
        v[i] = i;
    }
    
    for (uint8_t i = 0; i < 5; ++i) {
        NSLog(@"%d\n", v[i]);
    }
    
    free(v);
    

    Note that uint8_t is the same as unsigned char:

    #ifndef _UINT8_T
    #define _UINT8_T
    typedef unsigned char         uint8_t;
    #endif /*_UINT8_T */
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I currently have this code: static void func( uint8_t var ); static volatile uint8_t
Right now I'm doing as follow: uint8_t ManualFlow = 40; // 0 -> 255
Related to my other question , please help me debug An unhandled exception of
So let's say we want to load some XML - var xmlURL:String = 'content.xml';
static uint8_t togglecode[256] = { [0x3A] CAPSLOCK, [0x45] NUMLOCK, [0x46] SCROLLLOCK }; What's the
Given the following code sample: uint8_t i, in, ni; i = in = 2;
I have a range of C functions: const char* find_string(uint8_t id); int32_t find_int32(uint8_t id);
I have a std::vector<uint8_t> that contains strings at specific offsets. Here's a shortened dump:
int main() { return 0; } const uint8_t* byteHunter(const uint8_t *Search, uint16_t sLength, const
Why does the expression: test = cast(strtrim('3'), 'uint8') produce 51? This is also true

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.