+91 90691 39140 | +1 253 214 3115 | info@hub4tech.com | hub4tech

Delphi Interview Questions and Answers

What are the different types of pointers used in Delphi?
  • There are typed pointers types that are being provided by Delphi like PChar and PExtended.
  • These points work with the Inc and Dec functions and don’t have any issue with the use of it.
  • They can increment the Pint64 pointer type and add the SizeOf(Int64) bytes at the pointer address location.
  • This way it allows the pointing of the pointer to point to the next memory location in the memory.
  • There are generic pointers that are used to point to anything and very useful in case of dynamic memory allocation.
What is Delphi?

Delphi is a product of Borland International. It is a native code compiler that runs under Windows 3.1 and provides visual programming tools somewhat similar to those found in Microsoft Visual Basic 3.0. The underlying language is Object Pascal, which is an extension of the object-oriented Pascal found in Turbo/Borland Pascal starting with version 5.5.

What is the function of Dynamic arrays?
  • Dynamic arrays are the array type that defines their sizes at runtime or according to the data entered.
  • The dynamic arrays are declared and defined as shown below:

    wishes : array of string;
    SetLength(wishes, 3);

  • SetLength is a routine that is used to set the array size according to the string entered.
  • The size of the string or the input is defined at runtime that is why it is called dynamic arrays.
  • The array size can be changed and decreased or increased according to the requirements.
  • Dynamic arrays starts with an index 0 and it can grow according to the need of the input.
What versions of Delphi are there?

Delphi has been available in beta-test for many months now, and Borland has also given away a large number of "prerelease" copies. As far as the official release is concerned, though, there are two packages: Delphi (sometimes referred to as Delphi Desktop) and Delphi Client/Server. Both are version 1.0.

What are the different ways of defining array sizes?

There are many ways in Delphi to define the size of the array and these are as follows:

  • Days array: defines the fixed dimension from 1-7. It has indexing values that keeps the data indexed.
  • The index range can be defined by using the type enumeration and sub-ranges according to the size that is being provided.
  • The arrays defined below use the enumeration and sub-ranges that define the size of the array in an easy way like:

    TCars = (Ford, Vauxhall, GM, Nissan, Toyota, Honda);
    cars : array[TCars] of string;
    japCars : array[Nissan..Honda] of string;

  • Here we define the enumeration values to properly index the values of the arrays and these are as follows:

    japCars[Nissan] := 'Bluebird'; // Allowed
    japCars[Ford] := 'Galaxy'; // Not allowed

Copyright ©2015 Hub4Tech.com, All Rights Reserved. Hub4Tech™ is registered trademark of Hub4tech Portal Services Pvt. Ltd.
All trademarks and logos appearing on this website are the property of their respective owners.