Tryin to finish some C# tutorial examples, I write VB and some procedural proprietary languages at work and must learn C#.
I am having trouble with OOP and syntax: Why does the writeline command return no values? My struct contains the method and variables I want passed to the Main Method.

Output should be min from midnight.

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace TestTime
{




    class Program
    {
        public struct Time
        {
            private readonly int minutes;

            public Time(int hh, int mm)
            {
                this.minutes = 60 * hh + mm;
            }
            public override String ToString()
            {
                return minutes.ToString();
            }


        }  

        public void WriteTime()
        {
            Console.WriteLine("Time= ", );
        }

        static void Main(string[] args)
        {

            Time time =  new Time(9, 30);

            Console.WriteLine("Time= ", time);
            Console.WriteLine("Press Any Key");
            Console.ReadKey();



        }
    }
}

Edited 3 Years Ago by mike_2000_17: Fixed formatting

there shld be a placeholder for writeline to print the value on to display

writeline syntax shld be like

Console.WriteLine("time={0}",time.ToString());
or
Console.WriteLine("time=" +time.ToString());

This article has been dead for over six months. Start a new discussion instead.