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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 10, 20262026-05-10T20:55:22+00:00 2026-05-10T20:55:22+00:00

What is the C# equivalent of Delphi’s FillChar ?

  • 0

What is the C# equivalent of Delphi’s FillChar?

  • 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. 2026-05-10T20:55:22+00:00Added an answer on May 10, 2026 at 8:55 pm

    If I understand FillChar correctly, it sets all elements of an array to the same value, yes?

    In which case, unless the value is 0, you probably have to loop:

    for(int i = 0 ; i < arr.Length ; i++) {     arr[i] = value; } 

    For setting the values to the type’s 0, there is Array.Clear

    Obviously, with the loop answer you can stick this code in a utility method if you need… for example, as an extension method:

    public static void FillChar<T>(this T[] arr, T value) {...} 

    Then you can use:

    int[] data = {1,2,3,4,5}; //... data.FillChar(7); 

    If you absolutely must have block operations, then Buffer.BlockCopy can be used to blit data between array locatiosn – for example, you could write the first chunk, then blit it a few times to fill the bulk of the array.

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

Sidebar

Related Questions

Exist a .net class equivalent to the TTimer delphi component? TTimer is used to
Is there any equivalent of DocTest for Delphi. I use DUnit but I like
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
I'm looking for RTL delphi function equivalent to the sscanf/swscanf C++ functions. Exist something
What is the equivalent Delphi code for the following in C: int32 *P; int32
What is the equivalent of the c# lock() statement in Delphi Prism? In VB.Net
Does anyone know what's the .NET/C# equivalent of Delphi's forceDirectory function ? For who
I am looking for a method equivalent to Delphi's System.Frac in .NET. The Delphi
Is there a Java Swing component equivalent to Delphi's TDBCtrlGrid ? Or can the

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.