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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T12:29:53+00:00 2026-06-13T12:29:53+00:00

I think that C++ supports something on the lines of : Object objects[100]; This

  • 0

I think that C++ supports something on the lines of :

Object objects[100];

This would instantiate a 100 objects, right? Is it possible to do this in Delphi (specifically 2007)? Something other than:

for i:=0 to 99 do
  currentObject = TObject.Create;

or using the Allocate function, with a passed size value a hundred times the TObject size, because that just allocates memory, it doesn’t actually divide the memory and ‘give’ it to the objects.
If my assumption that the c++ instantiation is instant rather than under-the-hood-iterative, I apologize.

  • 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-13T12:29:54+00:00Added an answer on June 13, 2026 at 12:29 pm

    What you are looking for is impossible because

    • Delphi does not support static (stack allocated) objects.
    • Delphi objects do not have default constructors that can be automatically invoked by compiler.

    So that is not a lack of ‘sugar syntax’.


    For the sake of complete disclosure:

    • Delphi also supports legacy ‘old object model’ (Turbo Pascal object model) which allows statically allocated objects;
    • Dynamic object allocation itself does not prevent automatic object instantiation syntax, but makes such a syntax undesirable;
    • Automatic object instantiation syntax is impossible because Delphi does not have default constructors: Delphi compiler never instantiate objects implicitly because it does not know what constructor to call.
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Do you think that C# will support something like ??= operator? Instead of this:
I think that handlers in android are tools to get different objects that are
I think that this problem can be sorted using reflection (a technology which I'm
I think that some newer languages like JS can do this natively, but I
ScottGu says .NET MVC 2.0 has built in DataAnnotation support, I think that means
I think that I'm probably not writing lazily instantiated methods/attributes in the most ruby
just think that when I opened my file then when I want to write
I think that Visual Studio's biggest let down is the Javascript editor. I have
I think that the zipper is a beautiful idea; it elegantly provides a way
I would like my class to be: class NumberedString : public Object { public:

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.