(유니티 unity) c#, 자료형

 

int 정수 (약 -21억 ~ +21억)             int aa = 100;
long 정수 (약 -922경 ~ +922경)      long nn = 1000000;
float 실수 (소수 6자리)                   float ff = 0.1f;
double 실수 (소수 14자리)             double dd = 0.111111d;
string 문자열                                  string tt = “test”
bool 참(true), 거짓(false)                bool bb = false;
char 문자 1글자                              chr cc = 'a';
short 정수 (약 -6만 ~ +6만)

 

 

using System.Collections;

using System.Collections.Generic;

using UnityEngine;

 

public class NewBehaviourScript : MonoBehaviour

{

     int gold = 500;

     long money = 10000000000;

     float half = 0.5f;

     double d = 1.1111d;

     string word = "Helo Would";

     bool Check = false;

     char ch = 'c';

     void Start()

     {

          print(gold);

          print(money);

          print(half);

          print(d);

          print(word);

          print(Check);

          print(ch);

     }

}

 

 

 

+ Recent posts