473,396 Members | 1,892 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

How to Get Element Type of an Array Object?

If I get an object with its type declared as Sysem.Array(not in the explicit
form like 'ElementType[]' in C#), then how to retrieve the exact element
type of that array?
Sep 4 '07 #1
2 9703
On Sep 4, 12:59 pm, "Laser Lu" <laser...@163.comwrote:
If I get an object with its type declared as Sysem.Array(not in the explicit
form like 'ElementType[]' in C#), then how to retrieve the exact element
type of that array?
myArray.GetType().GetElementType()

Jon

Sep 4 '07 #2
Ok, thank you, Jon:)

"Jon Skeet [C# MVP]" <sk***@pobox.comwrote in message
news:11**********************@22g2000hsm.googlegro ups.com...
On Sep 4, 12:59 pm, "Laser Lu" <laser...@163.comwrote:
>If I get an object with its type declared as Sysem.Array(not in the
explicit
form like 'ElementType[]' in C#), then how to retrieve the exact element
type of that array?

myArray.GetType().GetElementType()

Jon


Sep 4 '07 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

10
by: Ramprasad A Padmanabhan | last post by:
Hi All, I am a c/perl programmer trying my hand at C++. In my code below I have an array class where I am trying to add two arrays using "+" . I am not sure why I get a '0' always for the first...
3
by: Don | last post by:
My user control has a combobox with an arraylist attached to it along with custom add and remove methods. The "Add" method is working great. However I don't understand why the "Remove" method...
7
by: Brett | last post by:
I need an object/structure such as an array but each item within the array is a complex structure. For example, I have 5 items, say: A thru E. The number of items may change. Each item has...
1
by: Rob Griffiths | last post by:
Can anyone explain to me the difference between an element type and a component type? In the java literature, arrays are said to have component types, whereas collections from the Collections...
2
by: dtra | last post by:
hi all i've got this application where a user selects tabs on the page, which then loads a different section onto another section of the page we currently have it working using ajax, but we...
5
by: junky_fellow | last post by:
Hi, I discussed about this earlier as well but I never got any satisfactory answer. So, I am initiating this again. Page 84, WG14/N869 "If both the pointer operand and the result point to...
7
by: Michael Bray | last post by:
Let's say I am using reflection to analyze my classes, and I have an array of another class. How do I get the base class that forms the array from a type? public class A { } A MyArray =...
3
by: walex | last post by:
Hello guys, I'm trying to install devsec an application for ffpeg for camera,but on,is a c programme,after compilation ,i now type make, then this two error are generated.common.h:67: error: array...
10
by: arcadio | last post by:
Hi everyone, I'm currently struggling to compile a large piece of legacy code. GCC 3.3 compiles it without complaining, but GCC 4.2.3 (the default in Debian) refuses it and signals "several...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.