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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T11:47:29+00:00 2026-05-24T11:47:29+00:00

First off, no I am not a student…just a C# guy porting a C++

  • 0

First off, no I am not a student…just a C# guy porting a C++ library.

What do these two crazy lines mean? What are they equivalent to in C#? I’m mostly concerned with the size_t and sizeof. Not concerned about static_cast or assert..I know how to deal with those.

size_t Index = static_cast<size_t>((y - 1620) / 2);
assert(Index < sizeof(DeltaTTable)/sizeof(double));

y is a double and DeltaTTable is a double[]. Thanks in advance!

  • 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-24T11:47:30+00:00Added an answer on May 24, 2026 at 11:47 am

    size_t is a typedef for an unsigned integer type. It is used for sizes of things, and may be 32 or 64 bits in size. The particular size of a size_t is implementation defined, but it is unsigned.

    I suppose in C# you could use a 64-bit unsigned integer type.

    All sizeof does is return the size in bytes of a C++ type. Every type takes up a certain quantity of room, and sizeof returns that size.

    What your code is doing is computing the number of doubles (64-bit floats) that the DeltaTTable takes up. Essentially, it’s ensuring that the table is larger than some size based on y, whatever that is.

    There is no equivalent of sizeof in C#, nor does it need it. There is no reason for you to port this code to C#.

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

Sidebar

Related Questions

First off, I'm not a math guy, so large number precision rarely filters into
First off, I am not an AS 400 guy - at all. So please
First off, please do not tl;dr this. It just a lot of quickly-scannable code.
First off, I'm not all that familiar with cookies but I know how they
First off, I am not a DBA, but I do work in an environment
First off, I'm not an expert with MySQL queries, and I can't seem to
First off, this is NOT a duplicate of: Turn a C string with NULL
First off, let me start off that I am not a .net developer. The
First off I'm not a Java expert by any stretch, nor am I a
First off, I'm not terribly experienced in XML. I know the very basics of

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.