摘要:一 在C源文件中调用C++封装的接口 例如: 要想在A.c文件中,调用生命在B.h,实现在B.cpp中的接口bool getMAC(char *mac_addr); 其实现方法 B.cpp 如下: 1 // B.cpp 2 3 #ifndef _cplusplus 4 #define _cplusp
阅读全文
随笔分类 - C/C++通用
摘要:1 #include "stdafx.h" 2 #include "iostream" 3 #include "assert.h" 4 5 using namespace std; 6 7 int mystrcmp(const char* dest, const char* src) 8 { 9 a
阅读全文
摘要:1 #include "stdafx.h" 2 #include "iostream" 3 #include "assert.h" 4 #include "string" 5 6 using namespace std; 7 8 char* mystrcat(char* dest, const ch
阅读全文
摘要:1 #include "stdafx.h" 2 #include "iostream" 3 #include "assert.h" 4 5 using namespace std; 6 7 char* mystrncpy(char* dest, const char* src, int n) 8 {
阅读全文
摘要:1 #include "stdafx.h" 2 #include "iostream" 3 4 using namespace std; 5 6 int isechol (const char* str) 7 { 8 int length = strlen(str); 9 for (int i=0;
阅读全文
摘要:1 #include "stdafx.h" 2 #include "iostream" 3 #include "assert.h" 4 5 using namespace std; 6 7 char* mystrcpy(char* dest, const char* src); // 1 const
阅读全文
浙公网安备 33010602011771号