Filter by Tags

Adding values to a C# array

Votes

0

0 0
This Question is relate to a Discussion :
How to generate a random int number using C#

How to use arrays in C# ? How can I add values to C# array ?

Open E-School
Posted on : Sun, Jan 07, 2018
Views : 111
Comments

Ask Question

If you want to ask question you must LogIn or SignUp
Login SignUp

Answers (2)


0

Adding values to a C# array
Declaring and Initializing an Integer Array

int[] array = new int[4];

array[0] = 1;
array[1] = 2;
array[2] = 3;
array[3] = 4;



Sarabjeet Singh
Wed, Jan 24, 2018
Loading...
Comments

Edit Answer

Submit

0

The syntax for using arrays in C# is a little different from that of C and C++. To add values to a C# array we can use the for loop in the following manner

int count = 0;

for(count=0; count<10; count++)
{
    array[count] = count;
}

For more information please go through the following article

http://openeschool.com/tutorial/3179/csharp-tutorials-how-to-create-and-use-arrays-in-csharp

Ravinder Singh
Thu, Jan 18, 2018
Loading...
Comments

Edit Answer

Submit
This answer will permanently deleted. Do you really want to delete this Answer ?
To Add your Answer Please
LogIn | SignUp

Quick Links

E-Magazines

@

Total Followers
Study Group Created
Study Group Joined
Following Teacher
Following Organization
Blog Articles Added
Questions Asked
Questions Answered
Jobs Posted
Total Members in Group
Questions asked by members
Tasks added in this Group

Please wait..

Ok

Login to Open ESchool OR Create your account    Login   SignUp