#include #include void main() { struct tm *t; time_t timer; // 시간측정 timer = time(NULL); // 현재 시각을 초 단위로 얻기 t = localtime(&timer); // 초 단위의 시간을 분리하여 구조체에 넣기 printf("현재 시간은 "); printf("%d년 %d월 %d일 %d시 %d분 %d초입니다.\n", t->tm_year + 1900, t->tm_mon + 1, t->tm_mday, t->tm_hour, t->tm_min, t->tm_sec); }
const int a = 1; // read as "a is an integer which is constant" int const a = 1; // read as "a is a constant integer" Both are the same thing. Therefore: a = 2; // Can't do because a is constant The reading backwards trick especially comes in handy when you're dealing with more complex declarations such as: const char *s; // read as "s is a pointer to a char that is constant" char c; cha..
umask 0022 = 755 for dirs & 644 for files. umask 0000 = 777 for dirs & 666 for files. umask 0027 = 750 for dirs & 640 for files. umask 0077 = 700 for dirs & 600 for files umask 0007 = 770 for dirs & 660 for files File의 경우 666, Directory의 경우 777을 기준으로 하며 default permission은 xxx - mask 값으로 한다.
Display display; display = ((WindowManager) context.getSystemService(context.WINDOW_SERVICE)).getDefaultDisplay(); DisplayMetrics metrics = new DisplayMetrics(); display.getMetrics(metrics); // cell size of a widget in portrait mode int xCellSize = 80; int yCellSize = 100; if (metrics.widthPixels > metrics.heightPixels) { // this means we're in landscape mode, so the cell sizes are adjusted xCel..
Problem: Failed to complete Gradle execution Cause: A fatal exception has occurred. Program will exit Solution Go to File -> Settings -> Gradle Input the following in the "Gradle VM options:" box: -XX:MaxHeapSize=256m -Xmx256m Hit apply and Android Studio should build your project successfully.
버전 명 String versionName = getPackageManager().getPackageInfo(getPackageName(), 0).versionName; 버전 코드 int versionCode = getPackageManager().getPackageInfo(getPackageName(), 0).versionCode;