03 2014 档案

摘要:const引用.const引用是指向const对象的引用:const int ival = 1024;const int &refVal = ival; 正确,引用和引用的对象都是constint &ref2 = ival; 这是错误的,因为引用不是constint i = 42;const int &r = 42//这是正确的,但是 int &r = 42.这个就是错误的.const int &r2 = r+i;非const引用只能帮顶到与该引用同类型的对象const引用则可以帮顶到不同但相关的类型的对象或帮顶到右值. 阅读全文
posted @ 2014-03-13 10:29 CrazyCode. 阅读(123) 评论(0) 推荐(0)
摘要: 阅读全文
posted @ 2014-03-06 13:58 CrazyCode. 阅读(237) 评论(0) 推荐(0)
摘要:1 #include "stdafx.h" 2 #include 3 #include 4 #include 5 using namespace std; 6 7 typedef char VertexType; 8 typedef int EdgeType; 9 const int MAXVEX = 100; 10 const int INFINITY = 65535; 11 int visited[MAXVEX]; 12 class EdgeNode 13 { 14 public: 15 int adjvex; 16 EdgeType weigh... 阅读全文
posted @ 2014-03-06 09:52 CrazyCode. 阅读(987) 评论(0) 推荐(0)
摘要:1 #include "stdafx.h" 2 #include 3 #include 4 5 using namespace std; 6 7 typedef char VertexType; 8 typedef int EdgeType; 9 const int MAXVEX = 100; 10 const int INFINITY = 65535; 11 12 class MGraph 13 { 14 public: 15 VertexType vex[MAXVEX];//顶点表 16 EdgeType arc[MAXVEX][MAXVEX]... 阅读全文
posted @ 2014-03-06 01:32 CrazyCode. 阅读(1699) 评论(0) 推荐(0)