answersLogoWhite

0

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

14y ago

What else can I help you with?

Related Questions

What is the difference between sharp and extra sharp cheddar cheese?

The main difference between sharp and extra sharp cheddar cheese is the intensity of flavor. Extra sharp cheddar has a stronger, more pronounced taste compared to sharp cheddar, which is milder.


What is the difference in taste between mild and sharp cheddar cheese?

The difference in taste between mild and sharp cheddar cheese is that mild cheddar has a milder, smoother flavor, while sharp cheddar has a stronger, more tangy taste.


What is the difference in sound between playing a sharp and a B flat on a musical instrument?

The difference in sound between playing a sharp and a B flat on a musical instrument is that a sharp note is slightly higher in pitch than a B flat note.


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 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