B
B
blzt2014-04-19 15:09:56
C++ / C#
blzt, 2014-04-19 15:09:56

With sharpe.static string Fioo is executed first. Why isn't static void main executed first?

static void Main(string[] args)
{
int dannie;
string fio = fioo();
Console.Write("...");
dannie = Int32.Parse(Console.ReadLine());
if (dannie == 0)
Console.WriteLine("Enter student's last name:" + fio);
Console.ReadKey();
}
static string Fioo(byte maxSize = 10)
{
string fio;
int count = 0, dx = 0;
do
{
if (count != 0) Console.WriteLine(" Exceeded data size by {0} characters! ", dx);
Console.Write("Enter student's last name:");
fio = Console.ReadLine();
dx = fio.Length - maxSize;
++count;
} while (dx > 0);
Console.Clear();
return fio;

Answer the question

In order to leave comments, you need to log in

1 answer(s)
N
Nikita Permin, 2014-04-19
@blzt

Yes, because you yourself call Fioo at the very beginning of Main() ( string fio = Fioo(); )

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question