Как перенести значение одной переменной в другую переменную в другом классе - C#
Формулировка задачи:
Вот часть кода :
Листинг программы
- static void Main(string[] args)
- {
- int choise;
- Console.WriteLine(@"
- [1]C#
- [2]FreePascal
- ");
- choise = int.Parse(Console.ReadLine());
- string file = Console.ReadLine();
- string info = Console.ReadLine();
- Compilation csc = new Compilation(file);
- if (csc.Errors.IndexOf("error")!=-1)
- {
- Console.WriteLine(csc.Errors);
- }
- else
- {
- Test test = new Test(info);
- Console.WriteLine(test.Start(file));
- }
- Console.ReadLine();
- }
- }
- public class Compilation
- {
- private FileInfo code_file;
- Compilation choose = new Main(choise);
- private FileInfo csc_file = new FileInfo(@"C:\FPC\3.0.0\bin\i386-win32\fpc.exe ");
- private string errors;
Решение задачи: «Как перенести значение одной переменной в другую переменную в другом классе»
textual
Листинг программы
- class Person1
- {
- public static void PersonS(string ter)
- {
- string pr = ter;
- }
- }
- class Person2
- {
- public static void PersonD(string ter)
- {
- Person.PersonS(ref ter);
- }
- }
ИИ поможет Вам:
- решить любую задачу по программированию
- объяснить код
- расставить комментарии в коде
- и т.д