2012年1月6日

c++的const的用法

摘要: 1 #include <iostream> 2 using namespace std; 3 int main() 4 { 5 int a = 10; 6 const int b = 20; 7 int *const p = &a; 8 *p = 30; 9 cout<<"a:"<<a<<" b:"<<b<<" *p:"<<*p<<endl;10 return 0;11 }1.const类型的指针。此处的指针p是const类型,其本 阅读全文

posted @ 2012-01-06 11:03 快跑蜗牛 阅读(168) 评论(0) 推荐(0) 编辑

vs08重置设置

摘要: 作为一个菜鸟,这样很不应该,但还是要说出来记录一下,也许有人用得着。vs08有很多框框可以随意拖动,但是解决方案管理栏不知道被我拖到哪里去了,视 图里面也调不出来,最后只好重置了。工具选项里面有个导入和导出设置子选项,点进去后可以选择备份或者直接重置,这样就恢复了默认视图。也许有更好的找到 某一栏的方法欢迎大家告诉我。 阅读全文

posted @ 2012-01-06 10:09 快跑蜗牛 阅读(379) 评论(0) 推荐(0) 编辑

linux下main函数的返回值问题

摘要: linux下c++的main函数必须要有返回值,类型必须为int,否则会报错。 1 //Listing2.vectdemo.cpp 2 3 #include <iostream> 4 #include <algorithm> 5 #include <vector> 6 7 using namespace std; 8 9 vector<int> ivec(100);10 11 int main()12 {13 ivec[20] = 50;14 vector<int>::iterator iiter = find(ivec.begin( 阅读全文

posted @ 2012-01-06 10:07 快跑蜗牛 阅读(729) 评论(0) 推荐(1) 编辑

导航