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

  • SEARCH
  • Home
  • 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 8543145
In Process

The Archive Base Latest Questions

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

I am having some trouble dealing with some C code. Can someone explain this

  • 0

I am having some trouble dealing with some C code. Can someone explain this syntax:

void some_function(Int16 omegaFlag[2][8])
{
    for(i = 0; i < 2; i++)
    {
        Int16 *Flag = omegaFlag[i] + 1;
        for(j = 0; j < k; j++)
        {
            // do some stuff
            *Flag++ = some_integer_value;
        }
    }
}

1. Why the parameter Int16 omegaFlag[2][8] passed in some_function() declares index values? How are they helping the code(in general, not specific to this code)?
2. *Flag++ = some_integer_value;: What does this line mean?

  • 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-11T12:14:03+00:00Added an answer on June 11, 2026 at 12:14 pm

    The first index to omegaFlag[2][8], is not required and is ignored by the compiler. The second, however, is important, because it tells the compiler this a two-dimensional array where each row contains 8 elements, so advancing the pointer will advance by 8 elements.

    omegaFlag[2][8] is equivalent to omegaFlag[][8] or (*omegaFlag)[8]. However it is different than **omegaFlag because of the memory layout. **omegaFlag is an array of pointers, while omegaFlag[2][8] is an array of arrays — with space for exactly 8 elements, or a total space for 16 elements.

    *Flag++ does two things, it de-references Flag, and then also increments its value by 1. Flag is a pointer to and Int16 representing the second value in the ith row of the matrix omegaFlag. The assignment assigns a value to that element, and then advances Flag to point to the next element, which will be assigned in the next iteration of the loop.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Having some trouble with this code. Trying to return a tuple of tuples (coordinates)
having some trouble with this can't understand why it won't work properly. http://host.philmadelphia2.com/~clare/order/ when
Having some trouble overriding ActionBarSherlock styles, hopefully someone can help. I have created a
Iam having some trouble with a PDO execute statement. My code looks like this:
Am having some trouble with the SkyDrive download process and hoping you can help
Im having some trouble writing a getstring function, this is what I have so
Im having some trouble with joining two tables. This is what my two tables
having some trouble with hitTestObject and now Flash is telling me it can't convert
I'm having some trouble compiling/linking a set of classes, several of them dealing with
I came across a ternary in some code and I am having trouble understanding

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.