原创 linux下readlink函數的基本用法(獲取程序運行路徑)
頭文件: #include <unistd.h> 定義函數:int readlink(const char *path, char *buf, size_t bufsiz); 函數說明:readlink()會將參數path的符號連
原创 字符操作
1、字符分類 bool bDigit1 = isdigit('1'); bool bDigit2 = isdigit('a'); bool bLower1 = islower('a'); bool bLower2 = islow
原创 位段
1、位段的來源 信息的存取一般以字節爲單位。實際上,有時存儲一個信息不必用一個或多個字節,例如,“真”或“假”用0或1表示,只需1位即可。 2、使用方法 C語言允許在一個結構體中以位爲單位來指定其成員所佔內存長度,利用位段能夠用較少的位數
原创 時間處理函數
time_t dwtime1 = time(0); struct tm *plocal1= localtime(&dwtime1); char *pctime1 = ctime(&dwtime1); time_t dwtim
原创 GitHub使用教程
1. 安裝TortoiseGit https://code.google.com/p/tortoisegit/downloads/list 2. 安裝msysGit https://code.google.com/p/msysgit/do
原创 C語言字符串操作函數
1、字符串長度strlen size_t strlen(char const *string); 2、複製字符串strcpy,strncpy char *strcpy(char *dst, char const *src); char
原创 共用體和枚舉
1、共用體,聯合體union 意義: 一般用來節省空間,因爲有些數據項是不可能同時出現的。聯合體中的所有成員是共享一段內存的。 特徵: (1)所有成員相對於基地址的偏移量都是0; (2)此結構空間要大到足夠容納最寬的成員; (3)對齊方
原创 Windows下c++獲取系統時間的三種方法
1、CTime類的static接口GetCurrentTime() 包含的頭文件#include <atltime.h> CTime類的對象表示的時間是基於格林威治標準時間(GMT)的。 CTime表示的日期上限是3000年12月31日,