随笔分类 - C++
摘要:Classesare an expanded concept ofdata structures:like data structures, they can contain data members, but they can also contain functions as members.A...
阅读全文
摘要:This caused a few problems the first time C++ was ported to a system where case wasn't significant in the filename, however, and different users adopt...
阅读全文
摘要:基本上是这样的,Sourcefile文件夹里面放的是CPP文件这些,Resourcefile文件夹是资源文件夹,里面可以放你程序里需要的资源,包括图标,对话框,图片等等;对应的文件如下:Source Files - *.c, *.cppHeader Files - *.hResource Files...
阅读全文
摘要:Data structuresAdata structureis a group of data elements grouped together under one name. These data elements, known asmembers, can have different types and different lengths. Data structures can ...
阅读全文
摘要:In the programs seen in previous chapters, all memory needs were determined before program execution by defining the variables needed. But there may be cases where the memory needs of a program can o...
阅读全文
摘要:ScopesNamed entities, such as variables, functions, and compound types need to be declared before being used in C++. The point in the program where this declaration happens influences its visibility:1...
阅读全文
摘要:Overloaded functionsIn C++, two different functions can have the same name if their parameters are different; either because they have a different number of parameters, or because any of their parameters are of a different type. For example:// overloading functions#include using namespace std;int op
阅读全文
摘要:FunctionsFunctions allow to structure programs in segments of code to perform individual tasks. In C++, a function is a group of statements that is given a name, and which can be called from some poi...
阅读全文
摘要:原地址http://www.cplusplus.com/doc/tutorial/pointers/PointersIn earlier chapters, variables have been explained as locations in the computer's memory which can be accessed by their identifier (their nam...
阅读全文
摘要:本文转载于 http://pcedu.pconline.com.cn/empolder/gj/c/0503/567942_all.html#content_page_1所有程序经过本人验证,部分程序经过修改: 验证平台 w530 ,ubuntu 12.10_x64, ecplise 4.3(with CDT)1. 结构体可以包含结构体指针,但绝对不能在结构体中包含结构体变量。(利用结构体的这点特...
阅读全文
摘要:本文转载于 http://pcedu.pconline.com.cn/empolder/gj/c/0503/567930_all.html#content_page_1所有程序经过本人验证,部分程序经过修改: 验证平台 w530 ,ubuntu 12.10_x64, ecplise 4.3(with CDT)1. 定义:构体就是一个可以包含不同数据类型的一个结构,它是一种可以自己定义的数据类型,...
阅读全文
摘要:原地址: http://blog.csdn.net/abcjennifer/article/details/7573916Linux下出现launch failed.Binary not found的解决方案:首先当你把网上关于mingw的解决方案都看晕了的时候,告诉你,别看关于mingw的了。Linux下不用mingw,直接由Linux GCC完成1、看你的Eclipse下面控制台Console输出,如果有g++ not found 的话,说明你的系统g++没安装成功。解决方案:Ctrl+Alt+t到terminal(控制台)模式,输入sudo apt-get install g++2、还不
阅读全文
摘要:1. c_str是把string类型强制转换为const string2. atpi(): Convert string to integer --Parses the C-string str interpreting its content as an integral number, which is returned as a value of type int.int atoi (const char * str);atol:Convert string to long integer (function )atof:Convert string to double (functio
阅读全文
摘要:As you are just learning C, i recommend you to really try to understand the differences between arrays and pointers first instead of the common things.In the area of parameters and arrays, there are a few confusing rules that should be clear before going on. First, what you declare in a parameter li
阅读全文
摘要:int main(int argc, char* argv[])這兩個參數的作用是什麼呢?argc 是指命令行輸入參數的個數,argv存儲了所有的命令行參數。假如你的程式是hello.exe,如果在命令行運行該程式,運行命令為:hello.exe hello world那麼,argc的值是 3,argv[0]是"hello.exe",argv[1]是"hello",argv[2]是"world"。...
阅读全文
摘要:学习C++ -> 引用( References )一、引用的介绍 引用就是某一变量(目标)的一个别名, 相当于同一个人有了两个名字, 无论喊哪一个名字实际上都是指的同一个人。 同样, 在引用上, 对引用的操作与对变量直接操作的效果完全一样, 因此, 修改引用的值就是在修改变量的值。 从内存角度来说, 引用与变量名指向的都是同一处内存, 对引用地址的操作与对变量名地址的操作都是对...
阅读全文
摘要:学习C++ -> 类(Classes)的定义与实现一、"类" 的介绍 在C++中, 用 "类" 来描述 "对象", 所谓的"对象"是指现实世界中的一切事物。那么类就可以看做是对相似事物的抽象, 找到这些不同事物间的共同点, 如自行车和摩托车, 首先他们都属于"对象", 并且具有一定得相同点, 和一些不同点, 相同点如他们都有质量、都有两个轮子, 都是属于交通工具等。"都有质量"、"两个轮子"属于这个对象的属性, 而"都能够当做交通工具&qu
阅读全文
摘要:原文:http://www.cnblogs.com/madengwei/archive/2008/02/18/1072410.html[摘要]指针是C和C++语言编程中最重要的概念之一,也是最容易产生困惑并导致程序出错的问题之一。利用指针编程可以表示各种数据结构, 通过指针可使用主调函数和被调函数之间共享变量或数据结构,便于实现双向数据通讯;并能像汇编语言一样处理内存地址,从而编出精练而高效...
阅读全文
摘要:原地址:http://www.cnblogs.com/marchtea/archive/2012/02/27/2370068.html前言: 以下的内容为我阅读c++沉思录18,19,20章的笔记以及自己的想法.正文: 总所周知,c++的stl中提出了iterator的概念,这是C所没有的.在一般的使用中,iterator的行为很像c内建的指针.而在 java和c#中索性就直接取消了指针,而采...
阅读全文

浙公网安备 33010602011771号