const修饰普通变量const int nValue;int const nValue;const修饰指针变量指针本身
原创 2023-11-04 04:47:37
107阅读
题目解决代码及点评/* 二分查找实现*/#include using namespace std;int BinarySearch(int *pnArr, int nLen, int nValue){ if (pnArr == NULL || nLen nValue) ...
转载 2013-12-22 22:01:00
27阅读
2评论
简单方法:    int const nValue; // nValue是const   char const * pContent;// *pContent是const, pContent可变   (char *) const pContent;//pContent是const,*pContent可变   char* const pContent;// pContent是co
转载 2010-04-28 12:23:12
1564阅读
  1)、const在前面    const int nValue; //nValue是const    const char *pContent; //*pContent是const, pContent可变    const (char *) pContent;//pContent是const,*pContent可变   
原创 2013-04-25 13:58:37
508阅读
// 输出二叉树中所有从根结点到叶子结点的路径.cpp : 定义控制台应用程序的入口点。#include "stdafx.h"#include #include using namespace std;struct BTNode{ char m_value; BTNode *m_left; BTNode *m_right;};//先序创建二叉树void CreatBTree(BTNode *&root){ char nValue = 0; cin >> nValue; if ('#' == nValue) { return; } else
转载 2013-10-07 21:11:00
147阅读
2评论
往链表末尾中添加结点C++版本struct ListNode{ int m_nValue; ListNode *m_pNext;};void AddToTail(ListNode **pHead, int value){ ListNode *pNew = new ListNode(); pNew->m_nValue = value; pNew-&g...
原创 2022-06-23 09:55:51
66阅读
// 输出二叉树中所有从根结点到叶子结点的路径.cpp : 定义控制台应用程序的入口点。#include "stdafx.h"#include #include using namespace std;struct BTNode{ char m_value; BTNode *m_left; BTNode *m_right;};//先序创建二叉树void CreatBTree(BTNode *&root){ char nValue = 0; cin >> nValue; if ('#' == nValue) { return; } else
转载 2013-10-08 22:09:00
98阅读
2评论
1. const修饰普通变量和指针const修饰变量,一般有两种写法:const TYPE value;TYPE const value;这两种写法在本质上是一样的。它的含义是:const修饰的类型为TYPE的变量value是不可变的。对于一个非指针的类型TYPE,无论怎么写,都是一个含义,即value只不可变。例如:const int nValue; //nValue是constint const nValue; // nValue是const但是对于指针类型的TYPE,不同的写法会有不同情况,例如:A. const char *pContent;B. char * const pConte
转载 2012-04-08 19:28:00
70阅读
2评论
传值操作#include using namespace std;struct ListNode{ int m_nValue; ListNode* m_pNext;};vo
原创 2022-08-21 00:04:44
72阅读
代码:#include "stdafx.h"#include #include using namespace std;struct BinaryTreeNode{ int m_nValue; BinaryTreeNode *m_pLeft;
转载 2013-07-22 19:13:00
9阅读
写这个文章完全是因为想要搞清楚 vc 怎么布局每个 c++ 对象,以及怎样完成指针的转换的过程.   先问一个问题,两个不同类型的指针相互转换以后,他们在数值上是一样的吗?比如:     int nValue = 10;     int *pInt = &nValue;     void *pVoid = pInt;     char *pChar = (char*)pInt
转载 精选 2011-07-14 10:50:16
379阅读
python学习第四讲,python基础语法之判断语句,选择语句,循环语句一丶判断语句 if1.if 语法if 判断条件 :条件成立的时候,会执行的代码如下:nValue = 10; if nValue == 10 : print("xxxx");注意问题:注意:代码的缩进为一个 tab 键,或者 4 个空格 —— 建议使用空格在 Python 开发中,Tab 和空格不要混用!我们可以把整个 if
题目用链表实现栈解决代码及点评#include #include #include #include #includetypedef struct Stack{ int nValue; struct Stack *pNext;}Stack, *PStack;PStack CreateStac...
转载 2014-01-17 16:26:00
50阅读
2评论
题目双向链表的实现解决代码及点评#include #include #include #include #includetypedef struct Link{ int nValue; struct Link *pPrev; struct Link *pNext;}Link, *PLink;...
转载 2014-01-17 16:41:00
33阅读
2评论
// test.cpp : 定义控制台应用程序的入口点。//#include "stdafx.h"#include typedef union tagGameAttributeValue{ int nValue; unsigned int uValue;...
转载 2016-09-24 11:50:00
47阅读
2评论
题目单向循环链表的操作解决代码及点评#include #include #include #include #includetypedef struct LoopLink{ int nValue; struct LoopLink *pNext;}LoopLink, *PLoopLink;PL...
转载 2014-01-17 16:33:00
33阅读
2评论
1.    Please specify what does “func()” do with the list "pParam", and what are the errors.struct LIST { int nValue; struct LIST * pPrev; struct LIST * pNext; };
题目二叉树实现解决代码及点评#include#include #include typedef struct BiTNode{ int nValue; struct BiTNode *pLChild; struct BiTNode *pRChild;}BiTNode, *PBiTree;//...
转载 2014-01-17 16:49:00
65阅读
2评论
题目单链表操作解决代码及点评#include using namespace std;struct LinkNode{public: LinkNode(int value = 0): nValue(value){ pNext = NULL; } ~LinkNode() { pNext = N...
转载 2014-01-17 16:31:00
44阅读
2评论
题目基于链表的队列实现解决代码及点评#include #include #include #include #includetypedef struct QNode{ int nValue; struct QNode *pNext;}QNode, *PQNode;typedef struct...
转载 2014-01-17 16:36:00
39阅读
2评论
  • 1
  • 2
  • 3
  • 4
  • 5