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 7434421
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T09:50:10+00:00 2026-05-29T09:50:10+00:00

What is the equivalent Delphi code for the following in C: int32 *P; int32

  • 0

What is the equivalent Delphi code for the following in C:

int32 *P;
int32 c0, c1, i, t;
uint8 *X;

t = P[i], c0 = X[t], c1 = X[t + 1];

Frankly, the comma operator confuses me. Is the following wildly wrong?

{$POINTERMATH ON}
var P: ^Int32; c0, c1, i, t: Int32; X: ^UInt8;

t:= P[i];   //<--?
c0:= X[t];
c1:= X[t+1];
t:= c1;     //<--?
  • 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-05-29T09:50:11+00:00Added an answer on May 29, 2026 at 9:50 am

    The comma operator in C has the lowest possible precedence. So your statement is equivalent to:

    (t = P[i]), (c0 = X[t]), (c1 = X[t + 1]);
    

    which is then evaluated from left to right. So it’s equivalent to:

    t = P[i];
    c0 = X[t];
    c1 = X[t + 1];
    

    However, if you had done something like this:

    z = (a = b, c = d);
    

    then it would be equivalent to this:

    a = b;
    c = d;
    z = c;
    

    because the comma operator “returns” its final operand.

    I should also point out that because each comma is a sequence point, stuff like this is well-defined:

    i = i + 1, i++, --i;
    

    where as this isn’t:

    i = i + i++ - --i;
    

    It almost goes without saying: if anyone wrote production C code like your first code snippet, I would have to spank them.

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

Sidebar

Related Questions

I've got the following Delphi code that defines a set and then a simple
I would like to know Delphi equivalent of the following operators. ++i/--i i++/i-- i+=1/i-=1
I'm looking for the Delphi eqivalent to the following Ruby Code if Time.now.hour >
Is there a Delphi equivalent of the C# #if(DEBUG) compiler directive?
What is the C# equivalent of Delphi's FillChar ?
Exist a .net class equivalent to the TTimer delphi component? TTimer is used to
Does anyone know of an equivalent to FxCop/StyleCop for Delphi? I would really like
I to need create a programmatic equivalent using delphi language... or could someone post
In external (Delphi-created) DLL I've got the following function that I need to call
I'm looking for RTL delphi function equivalent to the sscanf/swscanf C++ functions. Exist something

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.