局部变量
范围:在一个函数内部定义的变量,作用范围只限于本函数体内。
生存期:程序执行到本函数才会给局部变量分配内存单元,函数执行完毕局部变量所占的存储单元就被释放
全局变量
在函数体外部定义的变量是全局变量,可以被本文件所有其他函数访问使用。
作用域:所有文件。在一个cpp定义的全局变量在另一个cpp中使用,应该在使用它的函数体内部或外部进行...
分类:
编程语言 时间:
2015-07-13 16:07:39
阅读次数:
160
我使用的是opencv2.4.9,安装后,我的cvboost..cpp文件的路径是........\opencv\sources\apps\haartraining\cvhaartraining.cpp,研究源码那么多天,有很多收获,opencv库真是非常强大。其中在这篇博文中我有部分注释,其他的有关知识请参考我博客http://blog.csdn.net/ding977921830?viewmo...
分类:
其他好文 时间:
2015-07-13 12:20:37
阅读次数:
337
opengl 编程指南 P30
下面代码 是 用 直线 连起来 画一个圆。
// circle.cpp : 定义控制台应用程序的入口点。
//
#include "stdafx.h"
#include
#include
#define LENGTH 100
#define PI 3.1415926
void init(){
glClearColor(0,0,0,0);
}
...
分类:
其他好文 时间:
2015-07-13 00:54:55
阅读次数:
157
已hello.cpp为源文件,构建一个CMakeLists.txt cmake_minimum_required(VERSION?2.8)
project(hello)
add_executable(hello?hello.cpp) 在目录中的build 文件夹中进行cmake ..和make ,就可以编译源文件生成可运行...
分类:
其他好文 时间:
2015-07-12 23:31:10
阅读次数:
524
/* LList.cpp* Author: Qiang Xiao* Time: 2015-07-12*/#includeusing namespace std;class Node{ public: int data; Node* ptr; Node(int...
分类:
编程语言 时间:
2015-07-12 18:54:06
阅读次数:
212
引进一个二维数组Array[][],用Array[i][j]记录A[i]与B[j] 的LCS 的长度,sign[i][j]记录ARRAY[i][j]是通过哪一个子问题的值求得的,以决定搜索的方向。问题的递归式写成:回溯输出最长公共子序列过程:// LCSLength.cpp : Defines th...
分类:
其他好文 时间:
2015-07-12 18:48:19
阅读次数:
130
题目:Given a binary tree, determine if it is height-balanced.For this problem, a height-balanced binary tree is defined as a binary tree in which the de...
分类:
其他好文 时间:
2015-07-12 15:35:47
阅读次数:
106
// CMemory.cpp : Defines the entry point for the console application.//#include "stdafx.h"#include using namespace std;class Base {public: virtual ...
分类:
其他好文 时间:
2015-07-12 15:31:18
阅读次数:
99
这是帮别人做的一个题目,好久没有接触过C语言了,有点发怵,不过似乎找回点当时学C语言,做课程设计的感觉。
题目:定义一个数组(学生结构体数组),里面包含学号、姓名、身份证和三科学生成绩,要求写一个函数,根据学生任何一个字段(如学号、姓名、身份证),进行排序。
源码:
//// stu.cpp : Defines the entry point for the console applic...
分类:
编程语言 时间:
2015-07-12 14:20:37
阅读次数:
146
// PointtoMemberFunction.cpp : Defines the entry point for the console application.//#include "stdafx.h"#include using namespace std;class A{public: ....
分类:
其他好文 时间:
2015-07-12 14:07:40
阅读次数:
100