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();



        }
    }
}

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());

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.