上一页 1 ··· 6 7 8 9 10 11 下一页
摘要: 代码摘抄自 c和c++程序员面试秘籍 #include "stdafx.h" #include #include #include #include using namespace std; const char *str_reverse(const char* s1,const char *token) { stack stack1; const char *... 阅读全文
posted @ 2015-04-20 17:36 WQZ321123 阅读(383) 评论(0) 推荐(0)
摘要: // test_min_max.cpp : 定义控制台应用程序的入口点。 //实现字符串相同字符个数统计 // //样例输入:ajkhhhk //样例输出:a1j1k1hhh3k1 #include "stdafx.h" #include #include using namespace std; char *letter_count(char *str) { char *p... 阅读全文
posted @ 2015-04-18 21:46 WQZ321123 阅读(969) 评论(0) 推荐(0)
摘要: // test_min_max.cpp : 定义控制台应用程序的入口点。 // #include "stdafx.h" #include using namespace std; int find_max(int a,int b) { return a>b?a:b; } int find_min(int a,int b) { return a>b?b:a; } in... 阅读全文
posted @ 2015-04-18 19:39 WQZ321123 阅读(148) 评论(0) 推荐(0)
摘要: 首先需要有个头文件,名字随便写 假设test.h //test.h #ifndef _TEST_H #define _TEST_H #ifdef TEST_EXPORTS //通过宏定义控制是输入还是输出 #define TEST_API __declspec(dllexport) #else #define TEST_API __declspec(dllimport) #endi... 阅读全文
posted @ 2015-04-18 17:28 WQZ321123 阅读(191) 评论(0) 推荐(0)
摘要: // demo3.cpp : 定义控制台应用程序的入口点。 // #include "stdafx.h" #include #include using namespace std; int str_len(const char *str) { const char *temp=str; assert(str!=NULL); while(*str++!='\0... 阅读全文
posted @ 2015-04-11 20:49 WQZ321123 阅读(172) 评论(0) 推荐(0)
摘要: #include "stdafx.h" #include using namespace std; void func(char str[100]) { cout<<sizeof(str)<<endl; } int main() { char str[100]; func(str); //str传入函数做参数,做sizeof运算时被当做指针 返回4 ... 阅读全文
posted @ 2015-04-08 22:19 WQZ321123 阅读(227) 评论(0) 推荐(0)
摘要: #include "stdafx.h" #include using namespace std; int main() { int a[100]={0}; cout<<sizeof(a)/sizeof(a[0])<<endl; return 0; } 运行结果: 阅读全文
posted @ 2015-04-08 21:12 WQZ321123 阅读(338) 评论(0) 推荐(0)
摘要: 异或操作不是将两个数相加,所以不用担心会出现越界的问题 阅读全文
posted @ 2015-04-08 19:18 WQZ321123 阅读(207) 评论(0) 推荐(0)
摘要: // demo3.cpp : 定义控制台应用程序的入口点。//程序实现从母串中找到字串,并且输出字串在母串中的位置//audi.car@qq.com //2015年4月4日10:44:04#include "stdafx.h"#include using namespace std;int m... 阅读全文
posted @ 2015-04-04 11:50 WQZ321123 阅读(141) 评论(0) 推荐(0)
摘要: 参考网址:http://c.biancheng.net/cpp/biancheng/view/213.html// demo3.cpp : 定义控制台应用程序的入口点。//#include "stdafx.h"#include using namespace std;template class t... 阅读全文
posted @ 2015-04-04 09:06 WQZ321123 阅读(447) 评论(0) 推荐(0)
上一页 1 ··· 6 7 8 9 10 11 下一页