본문 바로가기
#커스텀다이얼로그# 띄워봅시다! 1234567891011121314151617181920212223242526272829303132333435Context mContext = getApplicationContext(); LayoutInflater inflater = (LayoutInflater) mContext .getSystemService(LAYOUT_INFLATER_SERVICE); View layout = inflater.inflate(R.layout.activity_send_user_message, (ViewGroup) findViewById(R.id.layout_root)); AlertDialog.Builder aDialog = new AlertDialog.Builder( CRSMainActivity.this); aDialo.. 2015. 6. 2.
#세자리마다 콤마# 정수형 숫자에 표시하기! 값이 0인경우 Null 출력 하기String.Format("{0:##,##}" 변수명);?1234567891011121314int total_cost = 12140104;int total_money_cost = 8278383;int total_card_cost = -7215663;int total_point_cost = 12280; string output = null;output = "";output += "" + "" + dsResult.Tables[0].Select().Length + "" + "";output += "" + "" + String.Format("{0:##,##}", total_money_cost) + "" + "";output += "" + "" + String.Format("{0:.. 2015. 6. 2.
#Sleep()# 함수 직접 만들어 봅시다! 문제 : sleep함수를 작성한다. 조건 1. sleep 함수는 int 형과 char형 두가지 형식을 매개변수로 받는다. ex] sleep(1), sleep("1") 2. 기존 Sleep()함수는 이용하지 않는다.※ Sleep() 란? Sleep은 스레드를 일정시간 정지시키는 함수 Sleep함수의 원형은 windows.h 헤더파일에 정의 되어있다. ex) Sleep(5000); //Sleep 스레드를 5초간 정지시킨다. 1초 = 1000 ■ 생각해보기 조건1을 위해 atoi()함수 사용 atoi() = 문자열을 정수형으로 변환 해주는 함수 헤더파일 stdlib.h 조건2를 위해 1) 아무 일을 수행하지 않는 반복문 사용 2) 현재 시간을 반환하는 time()함수 이용 헤더파일 time.h -> 현재 시간.. 2015. 6. 2.
#Hello World!# in C++ /* HelloWorldold.cpp HelloWorld 표준 스타일 2010. 08. 08 */#include int main(void) { std::cout 2015. 6. 2.