|
Computer درباره وبلاگ سلام این وبلاگ جهت آموزش برنامه نویسی ویژوال ساخته شده است آموزش سی شارپ ، ASP.net, ویژوال استودیو انشاءالله که به دردتون بخوره!!!!! آرشيو وبلاگ نويسندگان آراﻳﻪ ھﺎ در ﺳﻲ ﺷﺎرپ : آراﻳﻪ ھﺎ در ﺳﻲ ﺷﺎرپ : ;[]int[] table; // not int table
int[] numbers; // declare numbers as an int array of any size
numbers = new int[۱۰]; // numbers is a ۱۰-element array numbers = new int[۲۰]; // now it's a ۲۰-element array
String[] strData = new string[۲];
ﺗﻌﺮﻳﻒ و ﻣﻘﺪار دھﻲ اوﻟﯿﻪ string [] strData = { "۱۲۳۴","abcd" };
روﺷﻲ دﻳﮕﺮ ﺑﺮای ﻣﻘﺪار دھﻲ اوﻟﯿﻪ strData[۰] = "۱۲۳۴";
strData[۱] = "abcd";
ﺑﮕﺬارﻳﺪ. در اﻳﻦ ﻣﺜﺎل ﻣﻲ ﺧﻮاھﯿﻢex۰۶ ﺳﻲ ﺷﺎرپ را ﺑﺎز ﻛﻨﯿﺪ و ﻧﺎم آﻧﺮا در اﺑﺘﺪاConsole ﻣﺜﺎل : ﻳﻚ ﭘﺮوژه ی ﺟﺪﻳﺪ
: ﻧﺤﻮه ی ﻛﺎر ﺑﺎ آراﻳﻪ ھﺎ را ﻣﺮور ﻛﻨﯿﻢ
using System;
namespace ex۰۶ { class Class۱ { [STAThread] static void Main(string[] args) { string[] sGoalList = new string[۳]; string sReplyStatement = "You have choosen Goal '"; // Store goals in the array sGoalList[۰] = "Hike the Appalachian Trail"; sGoalList[۱] = "Run the marathon"; sGoalList[۲] = "Give $۱ million to worthwhile causes"; // Store response to goals in the array //(declaring and initializing on same line) string[] sGoalResponse = { "If you are staring from GA, you should get " + "started in early spring, so you will "+ "not get caught in snow.", "Make sure that you have a good pair of shoes.", "Start saving as soon as possible."}; // Give the user a list of goals to choose from Console.WriteLine("GOAL LIST"); for(int i = ۰; i < sGoalList.Length; i++) { Console.WriteLine("Goal " + i + " - " + sGoalList[i]); } .// Request the user to choose a goal Console.WriteLine (""); // Write an empty line for space " Console.Write("Please choose the number of the ;(" :[۲,۱,۰] + "goal that you want to achieve ;()Console.ReadLine { { {
منبع: سایت VCsharp.ir پيوندها |
|||
|
|
نام کاربری یا ایمیل خود را وارد کنید
کد ۶ رقمی ارسالشده به ایمیل و رمز عبور جدید را وارد کنید.
در چند ثانیه حساب کاربری خود را بسازید
دیدگاه خود را با ما در میان بگذارید
ورود کاربران
خوش آمدید! لطفا وارد حساب خود شوید