(유니티 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);
}
}
'유니티 unity, c#' 카테고리의 다른 글
(유니티 unity) c#, 산술 연산자 (0) | 2022.07.08 |
---|---|
(유니티 unity) c#, continue문 (0) | 2022.07.06 |
(유니티 unity) c#, 반복문, for문 (0) | 2022.07.06 |
(유니티 unity) c#, 변수 (0) | 2022.07.02 |
(유니티 unity) c#, 배열 (0) | 2022.06.29 |
(유니티 unity) c#, 반복문, while문 (0) | 2022.06.29 |
(유니티 unity) c#, IF문, 조건문, 제어문 (0) | 2022.06.28 |
(유니티 unity) c#, protected 접근제한자 (0) | 2022.06.28 |