answersLogoWhite

0


Best Answer

The syntax to access a particular element in an array are the same in both languages:

For example:

assume array is an array of 10 int(egers):

to get the first element: array[0] (both are 0 based indexing]

int i = 0;

while (i < array.Length) {

// do something to array[i]

}

int i = 0;

int length = sizeof(array) / sizeof(int);

while (i < length) {

// do something to array[i]

}

However, an array in C# is also enumerable (C does not have this feature)

in C#, you may loop thru the array by:

foreach (int number in array) {

// do something to array[i]

}

Plus, C# is an Object-Oriented Language, so that an array may be of some object types, not just those primitiives data types in C:

object[] objectArray; // any object derived from Object may be placed into objectArray, not just struct.

In another variation, an array may be of Delegate type in C#(sort of like function pointers in C)

User Avatar

Wiki User

13y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: What is the difference between array in c and c sharp language?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

How can you store Class properties in Array in c sharp?

vcbvcbcvb


What are the basic difference between c sharp and vbnet?

They use different syntax.


What is the difference between tangent continuity and curvature continuity?

Tangent continuity: No sharp angles. Curvature continuity: No sharp radius changes.


What is the difference between piano and celesta?

one is more sharp in timbre one is lower.


Why you use array in c sharp programming?

Any feature in any computer language should be based on the need. In the last 2 years, I have not come across any need to use an array in my job. Yes, I do use collections, a lot of them, just never a fixed-size collection.


What is the difference between A flat and B flat?

The difference between A and B in music is that A music is in a higher pitch than B and is harder to play.


What is the difference between a sharp angle and blunt angle?

Sharp mean Acute abgle (less than 90) and Lunt mean Obtuse angle between 90~180) Raza Hassan


What is the difference between a surfboard and a ski?

Surfboard has a sharp keel on its bottom while the ski bottom is smooth.


What is the difference between java and c sharp?

You can check out the wikipedia link provided in the related links for this question


What is the difference between tiger teeth and elephant teeth?

tiger teeth are sharp and elephant teeth are soft


What is the difference between cc plus plus and c sharp?

C# is inherited from c++ with some additional features


Is there a difference between the Verizon sharp kin 2 and kin 2?

One powered by virizon and the other by your mom