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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T18:18:13+00:00 2026-06-13T18:18:13+00:00

Coming from C++, it’s very weird to find that C# ArrayList doesn’t have Resize(count)

  • 0

Coming from C++, it’s very weird to find that C# ArrayList doesn’t have Resize(count) method?
Why? Am I missing something?

  • 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-13T18:18:14+00:00Added an answer on June 13, 2026 at 6:18 pm

    There are three separate operations you might wish to perform:

    • Changing the capacity of the ArrayList. This is achievable through ArrayList.Capacity and List<T>.Capacity

    • Changing the actual count of the list by trimming some elements. This is achievable through ArrayList.RemoveRange and List<T>.RemoveRange.

    • Changing the actual count of the list by adding some elements. This is achievable through ArrayList.AddRange and List<T>.AddRange. (As of .NET 3.5, you can use Enumerable.Repeat to very easily come up with a sequence of the right length.)

    (I mention List<T> as unless you’re really stuck on .NET 1.1, you’d be better off using the generic collections.)

    If you want to perform some other operation, please specify it. Personally I’m glad that these three operations are separate. I can’t think of any cases in my own experience where I’ve wanted to add or remove elements without knowing which I’d actually be doing.

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

Sidebar

Related Questions

Coming from a Java background, I understand that __str__ is something like a Python
Coming from a Java background, I'm wondering why List in Scala doesn't have a
Coming from a C# background, I have some habbits that need to be changed.
Coming from a PHP background, I'm used to writing small functions that return a
Coming from a Relational world things are obviously very different with the Azure Table
Coming from C++ it is hard grained into my mind that everytime I call
Coming from this question , I have a wxComboCtrl with a custom popup made
Coming from a perl background, I have always defined a 2D array using int[][]
Coming from C#, where class instances are passed by reference (that is, a copy
Coming from a non-Java background, I find myself writing a lot of View classes

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.