Answer the question
In order to leave comments, you need to log in
How to create an array that has data(name, text, information)?
Good evening! Straight to the point, I can't save data to an array. Example:
class TrainingPro
{
public string NameTraining { get; set; }
public string InitialPosition { get; set; }
public string HowToTraining { get; set; }
public string Сomplication { get; set; }
public TrainingPro (string NAME, string IP, string HTT, string CMP)
{
NameTraining = NAME;
InitialPosition = IP;
HowToTraining = HTT;
Сomplication = CMP;
}
*/----------------------------------------------------------------------------------------------------------------------------------------------------------------------------/*
static void Main(string[] args)
{
TrainingPro[] docs = new TrainingPro[]
{
docs=new docs { "Подкручивание таза1","Исходное положение1.","Как выполнять1."," "},
new docs { "Подкручивание таза2","Исходное положение2.","Как выполнять2."," "}
};
*/----------------------------------------------------------------------------------------------------------------------------------------------------------------------------/*
Console.WriteLine("NameTraining = {0} InitialPosition= {1} HowToTraining= {2} Сomplication= {3}", docs.NameTraining , docs.InitialPosition , docs.HowToTraining, docs.Сomplication);
Answer the question
In order to leave comments, you need to log in
What are you doing wrong? feverish nonsense is written in the comments. Have you tried opening the syntax tutorial at all? or decided to master the language by the method of scientific poke?
Well, it can be easier.
TrainingPro[] docs = new TrainingPro[someLength];
for(int i=0;i<someLength;i++)
{
docs[i] = new TrainingPro("NAME"+i, "IP"+i,"HTT"+i,"CMP"+i);
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question