본문 바로가기

Writer/WarmingUp Code

클래스 구조체

반응형
using System;

class cstest
{
public static void Method1(ctime t)
{
t.hour =12;
}
public static void Method2(stime t)
{
t.hour=12;
}
public static void Main()
{
ctime c = new ctime();
c.hour= 9;
Method1(c);
Console.WriteLine("{0}",c.hour);
stime s = new stime();
s.hour=9;
Method2();
Console.WriteLine("{0}",s.hour);

}
}

class ctime
{
public int hour;
}
struct stime
{
public int hour;
}

//////////////////////////////////////////////////////////////////////////////////////


using System;

class structclass
{
public static void method1(c)
{
c.hour =12;
}
public static void method2(s)
{
s.hour=12;
}
static void Main()
{
ctiem c = new ctiem;
c.hour = 9;
stime s;
Console.WriteLine("{0}",ctime.hour);
method1(c);
method2(s);
Console.WriteLine("{0}",c.hour);
Console.WriteLine("{0}",s.hour);
}
}

class ctime
{
           public int hour;
}
struct stime
{
         public int hour;
}













using System;

class cstest
{
public static void method1(ctime t)
{
t.hour = 12;
}
public static void method2(stime t)
{
t.hour = 12;
}
static void Main()
{
ctime c = new ctime();
c.hour = 9;
stime s;
s.hour = 9;
method1(c);
method2(s);
Console.WriteLine("클래스 : = "+c.hour);
Console.WriteLine("구조체 : = "+s.hour);
}
}

class ctime
{
public int hour;
}
struct stime
{
public int hour;
}
////////////////////////////////////////////////////////////
using System;
class cstest
{
public static void method1(ctime t)
{
        t.hour=12;
}
public static void method2(stime t)
{
       t.hour=12;
}
static void Main()
{
ctime c = new ctime();
c.hour=9;
time s;
s.hour=9
method1(c)
method2(s)
Console.WriteLine("{0}{1}", c.hour , s.hour)
}
}
class ctime
{
        public int hour
}
struct stime
{
        public int hour
}
////////////////////////////////////////////////////////////
using System;

class cstest
{
      public void method1(ctime t)
      {
            t.hour=12; 
      }
      public void method2(stime t)
      {
            t.hour=12;
       }
      static void Main()
      {
       ctime c = new  ctime();
       c.hour=9;
       stime s;
       s.hour=9;
       method1(c);
       method2(s);
       Console.WriteLine("{0}{1}",c.hour,s.hour);
       }
}
class ctime
{
      public int hour;
}
struct stime
{
    public int hour;
}
////////////////////////////////////////////////////////////
using System;
class cstest
{
public static void method1(ctime t)
{
t.hour=12;
}
public static void method2(stime t)
{
t.hour=12;
}
static void Main()
{
ctime c = new ctime();
c.hour = 9;
stime s;
s.hour = 9;
method1(c);
method2(s);
Console.WriteLine("클래스 : " +c.hour);
Console.WriteLine("구조체 : " +s.hour);
}
}
class ctime
{
public int hour;
}
struct stime
{
public int hour;
}

'Writer > WarmingUp Code' 카테고리의 다른 글

눈물의 소스 박스형 for와 if 사용 첨부 상철 상봉 오윤  (0) 2008.10.09
소스 복습  (0) 2008.10.08
객체지향 소스  (0) 2008.10.07
성적출력  (0) 2008.10.07
소스연습  (0) 2008.10.06
프로퍼티 웜업소스  (0) 2008.10.05
string ToString() bool float object enum boxing char  (0) 2008.10.04
복습  (0) 2008.10.02