Skip to content

Instantly share code, notes, and snippets.

@hunandy14
hunandy14 / Get_path
Created May 29, 2016 09:59
取得系統變數
/**********************************************************
Name :
Date : 2016/05/29
By : CharlotteHonG
Final: 2016/05/29
**********************************************************/
#include <iostream>
#include <stdlib.h>
using namespace std;
/*=======================================================*/
@hunandy14
hunandy14 / get_arraylen_at_function.cpp
Last active August 27, 2016 16:22
副程式取得陣列長度
/**********************************************************
Name : 副程式取得陣列長度
Date : 2016/05/31
By : CharlotteHonG
Final: 2016/06/19
**********************************************************/
#include <iostream>
template<size_t N>
void arr_len(int (&arr)[N]);
@hunandy14
hunandy14 / get_file_path.cpp
Created May 31, 2016 15:35
取得檔案路徑
#include <iostream>
#include <windows.h>
using namespace std;
int main(int argc, char const *argv[]){
char org_dir[MAX_PATH];
GetModuleFileName(NULL,org_dir,MAX_PATH);
cout << org_dir << endl;
return 0;
}
@hunandy14
hunandy14 / Point_example.c
Last active June 2, 2016 09:56
指標範例
/**********************************************************
Name : 指標範例
Date : 2016/06/02
By : CharlotteHonG
Final: 2016/06/02
**********************************************************/
/* 指標記住兩句話[*找數值][&找地址] */
#include <stdlib.h>
#include <stdio.h>
void modify(int* n1, int n2){
@hunandy14
hunandy14 / class_separate_struct.cpp
Created July 6, 2016 03:57
類別內有結構,如何將實作分開
/**********************************************************
Name : link
Date : 2016/07/05
By : CharlotteHonG
Final: 2016/07/05
**********************************************************/
#include <iostream>
#include "single"
using namespace std;
@hunandy14
hunandy14 / template_struct.cpp
Created July 6, 2016 05:30
樣板類別當結構用 (friend 繼承)
/**********************************************************
Name :
Date : 2016/07/06
By : CharlotteHonG
Final: 2016/07/06
**********************************************************/
#include <iostream>
using namespace std;
template <typename S1, typename S2>
@hunandy14
hunandy14 / User_iVlog.sublime-build
Last active July 27, 2016 16:01
Verilog 編譯效率 解決方案
/**********************************************************
Name : User_iVlog.sublime-build
Date : 2016/07/27
By : CharlotteHonG
Final: 2016/07/27
## 標準:
### 檔名:
1. 原始檔名為 Source.v
@hunandy14
hunandy14 / OpenRAW.cpp
Created August 3, 2016 09:44
讀取RAW檔案
/**********************************************************
Name : OpenRAW.cpp
Date : 2016/08/03
By : CharlotteHonG
Final: 2016/08/03
**********************************************************/
#include <iostream>
using namespace std;
/*=======================================================*/
#include <iostream>
@hunandy14
hunandy14 / class_test.cpp
Created September 5, 2016 12:48
說明類別
#include <iostream>
using namespace std;
// 解構子
class darr{
public:
darr(size_t len){
this->p = new int[len];
for (int i = 0; i < (int)len; ++i){
@hunandy14
hunandy14 / swapstr.c
Last active September 10, 2016 02:12
反轉字串或字元
#include <stdio.h>
#include <string.h>
char *swapstr_rec(char *str, int begin, int end, int first){
while (begin < end - 1){
char tmp = str[begin];
str[begin++] = str[--end];
str[end] = tmp;
}
end += begin;