C++/CLI 编程——使用 for each 循环存取字符串中的字符
摘要:除 ISO/IEC C++ 中定义的3种循环语句以外,C++/CLI 还提供了for each 语句。在C++/CLI 中,for each 循环的效率比其他几种形式的循环效率更高。#include"stdafx.h"using namespace System;int main(array ^a...
阅读全文
C++/CLI 编程——使用 for each 循环存取字符串中的字符
摘要:除 ISO/IEC C++ 中定义的3种循环语句以外,C++/CLI 还提供了for each 语句。在C++/CLI 中,for each 循环的效率比其他几种形式的循环效率更高。#include"stdafx.h"using namespace System;in...
阅读全文
常量指针和指向常量的指针
摘要:3种与const、指针及指针指向的对象有关的情形:1.指向常量对象的指针2.指向某个对象的常量指针3.指向常量对象的常量指针在第一种情况中,我们不能修改被指向的对象,但可以使指针指向其他对象:const char* pstring(“Some text”);在第二种情...
阅读全文
常量指针和指向常量的指针
摘要:3种与const、指针及指针指向的对象有关的情形:1.指向常量对象的指针2.指向某个对象的常量指针3.指向常量对象的常量指针在第一种情况中,我们不能修改被指向的对象,但可以使指针指向其他对象:const char* pstring(“Some text”);在第二种情况中,我们不能修改指针中存储的地...
阅读全文
初始化指针
摘要:#includeusing namespace std;int main(){ int *a(nullptr), *b(NULL), *c(0); if(!a) cout<<" 'a' does not point to anything. \n"; if(!b) c...
阅读全文
初始化指针
摘要:#includeusing namespace std;int main(){ int *a(nullptr), *b(NULL), *c(0); if(!a) cout<<" 'a' does not point to anything. \n"; if(!b) cout<<" 'b' does ...
阅读全文
C++/CLI——使用嵌套 if 语句的 CLR 程序
摘要:// 嵌套ifCLR.cpp: 主项目文件。#include "stdafx.h"using namespace System;int main(array ^args){ wchar_t letter; Console::WriteLine(L"Ente...
阅读全文
C++/CLI——使用嵌套 if 语句的 CLR 程序
摘要:// 嵌套ifCLR.cpp: 主项目文件。#include "stdafx.h"using namespace System;int main(array ^args){ wchar_t letter; Console::WriteLine(L"Enter a letter: "); ...
阅读全文