
C++
ColorPaper
游侠
展开
-
C++与JAVA的对比
C++与JAVA的对比一、C++的发展史语言的发展是一个逐步递进的过程,C++是直接从C语言发展过来的,而C语言是从B语言发展过来的,B语言是BCPL的一个解释性后代,BCPL是BasicCPL。其中最有趣的是CPL中C的由来,由于当时这个语言是剑桥大学和伦敦大学合作开发的,在伦敦的人员加入之前,C表示剑桥,伦敦人员加入之后,C表示Combined组合。还有一种非正式的说法,C表示Chri转载 2013-05-28 11:06:47 · 1392 阅读 · 0 评论 -
*** glibc detected *** free(): invalid next size (fast) — should work?
问:I'm working on an existing c project (spglib on sourceforge), and I'm running into the following problem after cleaning up some array initializations:* glibc detected tests/spglibtest:转载 2012-07-12 14:23:45 · 2088 阅读 · 0 评论 -
C++ Error: free(): invalid next size (fast):
It means that you have a memory error. You may be trying to free a pointer that wasn't allocated bymalloc (or delete an object that wasn't created by new) or you may be trying to free/deletesuch转载 2012-07-12 14:21:50 · 1782 阅读 · 0 评论 -
GNU Compiler for Java
GNU Compiler for JavaFrom Wikipedia, the free encyclopediaGNU Compiler for JavaDeveloper(s)The GNU ProjectOperating systemUnix-likeTypeCompilerLic转载 2012-06-18 12:36:35 · 833 阅读 · 0 评论 -
Why do we need extern “C”{ #include <foo.h> } in C++?
问:Why do we need extern “C”{ #include } in C++?Specifically:When should we use it?What is happening at the compiler/linker level that requires us to use it? How in terms of compila转载 2012-05-09 15:18:10 · 755 阅读 · 0 评论 -
Segmentation fault (core dumped)
Segmentation fault (core dumped)问:I am relatively new on C, I am trying to run a simple program and I get this Error message: Segmentation fault (core dumped) I just want to print any va转载 2012-04-23 11:40:50 · 886 阅读 · 0 评论 -
Linux命令之ar - 创建静态库.a文件
Linux命令之ar - 创建静态库.a文件 用途说明 创建静态库。a文件。用C/C++开发程序时经常用到,但我很少单独在命令行中使用ar命令,一般写在makefile中,有时也会在shell脚 本中用到。 用途说明 创建静态库。a文件。用C/C++开发程序时经常用到,但我很少单独在命令行中使用ar命令,一般写在makefile中,有时也会在shell脚 本中用到。关于Linux转载 2012-04-21 18:02:56 · 699 阅读 · 0 评论 -
gcc编译优化等级的区别
问:What is the difference between different optimization levels in GCC? Assuming I don't care to have any debug hooks, why wouldn't I just use the highest level of optimization available to me? doe转载 2012-04-26 14:13:14 · 1536 阅读 · 0 评论 -
因特尔SSE指令教程
Intel SSE Tutorial : An Introduction to the SSE Instruction SetTable of Contents+ Introduction, Prerequisites, and Summary+ SSE Introstructions+ Example 1: Adding Vectors+ Shuffling+转载 2012-04-26 14:07:56 · 2104 阅读 · 0 评论 -
在linux下使用汇编语言
Using Assembly Language in Linux.Last updated: Monday 8th January 2001Note: there is a turkish translation of this article.Contents:IntroductionIntel and AT&T SyntaxPrefixesD转载 2012-04-26 14:05:32 · 823 阅读 · 0 评论 -
error: expected class-name before '{' token
可能的原因有两个:1.头文件的宏定义是一样的,多个文件的下面AA是一样的#ifndef AA#define AA....#endif 2.继承的基类的头文件没有包含进来错误的原因是,该类继承的那个基类的头文件没有包含进来, You can get the errorexpected class转载 2012-08-21 15:07:41 · 1155 阅读 · 0 评论 -
C++ 毫秒时间
C/C++中的计时函数是clock(),而与其相关的数据类型是clock_t。在MSDN中,查得对clock函数定义如下:clock_t clock(void) ;这个函数返回从“开启这个程序进程”到“程序中调用clock()函数”时之间的CPU时钟计时单元(clock tick)数,在MSDN中称之为挂钟时间(wal-clock)。其中clock_t是用来保存时间的数据类型,在t转载 2012-09-26 18:02:55 · 1762 阅读 · 0 评论 -
JAVA和C++区别
1.指针 JAVA语言让编程者无法找到指针来直接访问内存无指针,并且增添了自动的内存管理功能,从而有效地防止了c/c++语言中指针操作失误,如野指针所造成的系统崩溃。但也不是说JAVA没有指针,虚拟机内部还是使用了指针,只是外人不得使用而已。这有利于Java程序的安全。 2.多重继承 c++支持多重继承,这是c++的一个特征,它允许多父类派生一个类。尽管多重继承功能很强,但使用复杂,而转载 2013-05-28 11:00:38 · 697 阅读 · 0 评论 -
Objective C与C++的可读性比较
ReadabilityHere's another fundamental difference. Objective C is inherently more readable than C++ because method parameters are built into the name of the method. Consider:// Objective C[layer a转载 2013-01-01 13:13:06 · 719 阅读 · 0 评论 -
【C++11】nullptr关键字
从1972年C语言刚刚诞生以来,常数0就扮演着整数(int)0和空指针( null pointer )两种角色。为了避免理解上的二义性,C语言通常使用NULL宏来表示空指针,NULL宏通常被定义为(void *)0或0, 而C++仅仅采用0来表示空指针,这样存在一个问题:比如对于重载函数 fun(char *) 和 fun(int) 的调用来说,若直接用NULL作为参数调用fun(NULL),我们转载 2013-01-01 02:01:24 · 573 阅读 · 0 评论 -
Cocos2d-X Basics
Now that you’ve had a C++ refresher, it’s time to get a grasp on the basics of Cocos2d-X.In this chapter, we will be learning how to create a scene, load a sprite and drag it around via touch contro转载 2013-01-01 02:51:48 · 837 阅读 · 0 评论 -
How C++11 Helps You Boost Your Developer Productivity
Programming languages come into vogue and then fade away. Meanwhile, C++ keeps going strong. Siddhartha Rao, author ofSams Teach Yourself C++ in One Hour a Day, 7th Edition, is convinced that the la转载 2013-01-01 01:51:37 · 649 阅读 · 0 评论 -
C++ vs Objective C
Are you a game developer transitioning from Cocos2d iPhone to Cocos2d-X? From Objective C to C++?C++ used to be my language. It was all I wrote computer games in for over 10 years. There's a certain转载 2013-01-01 13:24:09 · 1278 阅读 · 0 评论 -
uav自动飞行资料
SLAM算法http://www.asctec.de/uav-applications/research/applications/applications-2/slam/德国的一家多轴飞行器公司http://www.asctec.de/一个使用kicnect实现自动避障的飞行器http://www.ros.org/wiki/openni/Contests/转载 2012-10-18 17:22:12 · 974 阅读 · 0 评论 -
用DD命令制作硬盘镜像
用DD命令制作硬盘镜像 本文参考http://serverfault.com/questions/4906/using-dd-for-disk-cloning写出,转载时请说明出处。以下的说明都是针对备份整个硬盘,而不是备份某一个分区。 一、用DD命令制作硬盘镜像的特点 (1)在制作镜像时,不能对需要进行备份的硬盘经常写操作,可以只读挂载或者不挂载。原创 2012-09-28 17:50:46 · 16257 阅读 · 1 评论 -
FLOAT类型的值域
小数在C#中需要用浮点型表示,浮点值就是.后面的小数点。C#语言中有两种小数类型,分别为32位单精度浮点型(float)和64位双精度浮点型(double)。其中精度指的是小数位数,小数位数越多,精度越高。由名称可知,float类型的精度比double型的低,由位数可知,float类型的范围比double类型小。 float类型中小数位数为7位,即可精确到小数点后7位,表示范围为1.5e -转载 2012-09-27 13:19:53 · 3348 阅读 · 0 评论 -
vc++中设置栈的大小
c++的栈的大小是有限制的,多个局部变量累加确实也会增加内存占用,虽然局部变量是自动释放的。如果超出设置大小,程序直接崩溃。vc2005设置堆栈大小的方法:project->property->configuration properties->linker->system下的stack reserve size 和 heap reserve size设置。转载 2012-04-23 11:47:42 · 1699 阅读 · 0 评论 -
推荐几本C语言的好书!!!!
以下是csdn里的前辈所陈述,我来应用一下,也和大家分享一下! 。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。 (一)语言入门: 《C++ Primer》 最新版本:第三版(第四版国外已上架,国内一些网上书店也在预订中) 适合有丰富C经验,缺乏C++经验转载 2012-03-21 17:45:45 · 1563 阅读 · 0 评论 -
深入探讨C++中的引用
摘要:介绍C++引用的基本概念,通过详细的应用分析与说明,对引用进行全面、透彻地阐述。 关键词:引用,const,多态,指针 引用是C++引入的新语言特性,是C++常用的一个重要内容之一,正确、灵活地使用引用,可以使程序简洁、高效。我在工作中发现,许多人使用它仅仅是想当然,在某些微妙的场合,很容易出错,究其原由,大多因为没有搞清本源。故在本篇中我将对引用进行详细讨论,希望对大家转载 2011-12-24 17:28:25 · 430 阅读 · 0 评论 -
C++的map详解
mapclass templateMapMaps are a kind of associative container that stores elements formed by the combination of a key value and a mapped value.In a map, the key value is generally转载 2011-12-22 11:06:06 · 783 阅读 · 0 评论 -
C++中的类
Classes (I)A class is an expanded concept of a data structure: instead of holding only data, it can hold both data and functions.An object is an instantiation of a class. In terms转载 2011-12-21 19:25:24 · 731 阅读 · 0 评论 -
C++的模板详解
TemplatesFunction templatesFunction templates are special functions that can operate with generic types. This allows us to create a function template whose functionality can be adapt转载 2011-12-21 19:07:05 · 546 阅读 · 0 评论 -
C++的vector详解
vectorclass templateVectorVectors are a kind of sequence container. As such, their elements are ordered following a strict linear sequence.Vector containers are implemented as dy转载 2011-12-22 10:57:08 · 645 阅读 · 0 评论 -
C++异常详解
handlers.To catch exceptions we must place a portion of code under exception inspection. This is done by enclosing that portion of code in a try block. When an exceptional circumstance arises with转载 2011-12-22 09:13:38 · 1051 阅读 · 0 评论 -
C++ 容器类简介(摘抄)
C++中的容器类包括“顺序存储结构”和“关联存储结构”,前者包括vector,list,deque等;后者包括set,map,multiset,multimap等。若需要存储的元素数在编译器间就可以确定,可以使用数组来存储,否则,就需要用到容器类了。 1、vector 连续存储结构,每个元素是在内存上是连续的; 支持高效的随机访问和在尾端插入/删除操作,但其他位置的转载 2011-12-21 01:27:24 · 655 阅读 · 0 评论 -
让你的软件界面更漂亮(一)
让你的软件界面更漂亮(一)作者:朱一松下载源代码 我们使用过很多的软件,给我们留下印象很深的是那些界面漂亮且迷人的软件,国外的软件象QuickTime,国产的象金山词霸等,它们的软件界面设计风格都有独特之处。本人跟据自已的经验和大家探讨一下软件的漂亮界面实现的原理并提供DEMO程序。本人经验不多,经常从VCKBASE.COM吸取知识,共同学习,如有不足之处,请指正!也欢迎和我联系。下面就开始吧!一、漂亮界面实现的原理 用图象元素自绘窗口标题样栏,边框,系统按钮(最大化、最小化、关闭按钮)还有按窗口中的控转载 2010-12-29 22:52:00 · 1514 阅读 · 0 评论 -
C++的虚函数
<br />C++的虚函数<br /> <br />下面是对C++的虚函数这玩意儿的理解。<br />一, 什么是虚函数<br /> (如果不知道虚函数为何物,但又急切的想知道,那你就应该从这里开始)<br /> 简单地说,那些被virtual关键字修饰的成员函数,就是虚函数。虚函数的作用,用专业术语来解释就是实现多态性(Polymorphism),多态性是将接口与实现进行分离;用形象的语言来解释就是实现以共同的方法,但因个体差异而采用不同的策略。下面来看一段简单的代码<br />class A{ <b转载 2010-12-30 18:48:00 · 650 阅读 · 0 评论 -
C++内存管理
[导语]内存管理是C++最令人切齿痛恨的问题,也是C++最有争议的问题,C++高手从中获得了更好的性能,更大的自由,C++菜鸟的收获则是一遍一遍的检查代码和对C++的痛恨,但内存管理在C++中无处不在,内存泄漏几乎在每个C++程序中都会发生,因此要想成为C++高手,内存管理一关是必须要过的,除非放弃C++,转到Java或者.NET,他们的内存管理基本是自动的,当然你也放弃了自由和对内存的支转载 2011-12-24 19:18:02 · 551 阅读 · 0 评论 -
告别cpp&h:hpp文件编写心得(转)
hpp,顾名思义等于.h加上.cpp,在boost、Xerces等开源库中频繁出现,偶在机缘巧合之下,学得一招半式,遂记录如下,以供参考学习。 hpp,其实质就是将.cpp的实现代码混入.h头文件当中,定义与实现都包含在同一文件,则该类的调用者只需要include该hpp文件即可,无需再将cpp加入到project中进行编译。而实现代码将直接编译到调用者的obj文件中,不再生成单独的ob转载 2012-03-09 22:04:47 · 608 阅读 · 0 评论 -
C中如何创建.tar.bz2文件
问题I need to create a tarball of a directory and then compress it with bz2 in C++. Is there any decent tutorial on using libtar and libbz2?解决方法Okay, I worked up a quick example for you.转载 2012-03-06 11:41:47 · 1077 阅读 · 0 评论 -
Type Casting
Type CastingConverting an expression of a given type into another type is known as type-casting. We have already seen some ways to type cast:Implicit conversionImplicit convers转载 2012-02-25 18:45:47 · 1082 阅读 · 0 评论 -
c/c++在线编译器
c/c++在线编译器一直以来都喜欢用手机看书,尤其是在上班时。看的最多的是编程一类的书,主要是C++,看着就想写写代码,可是电脑用不能用,怎么办?于是想到用UC浏览器找找看网上有没有在线的编译器,想什么时候写代码都可以验证。于是就找了几个,各有千秋吧。中文的我没找到,全是英文的,不过英文不难,其实也不需要懂英文,只要知道在什么地方写代码,然后点击按钮进行在线编译就行了。好了转载 2012-02-23 20:17:05 · 786 阅读 · 0 评论 -
Linux 下编译JsonCpp——ZT
安装JsonCpp需要下载JsonCpp和Scon还需要机器上有pythonwget http://sourceforge.net/projects/jsoncpp/files/latest/download?_test=goal 下载JsonCppwget http://sourceforge.net/projects/scons/files/scons/2.1.0/s转载 2012-02-13 15:55:29 · 895 阅读 · 0 评论 -
Json_ C++ 处理 JSON 数据交换格式
一、摘要 JSON 的全称为:JavaScript Object Notation,顾名思义,JSON 是用于标记 Javascript 对象的,JSON 官方的解释为:JSON 是一种轻量级的数据传输格式。本文并不详细介绍 JSON 本身的细节,旨在讨论如何使用 C++ 语言来处理 JSON。关于 JSON 更具体的信息,可参见 JSON 官网:http://www.json.or转载 2012-02-13 15:54:45 · 667 阅读 · 0 评论 -
Linux Semaphore Tutorial
1.Introduction to SemaphoresSemaphores can be thought of as simple counters that indicate the status of a resource. This counter is a protected variable and cannot be accessed by the user directly.转载 2012-02-14 11:00:22 · 950 阅读 · 0 评论