C/C++
文章平均质量分 65
JohnsonElizeee
这个作者很懒,什么都没留下…
展开
-
结构体的字节对齐方式
结构体的字节对齐方式#includestruct a{ char no[10]; int p; long int pp; unsigned int ppp; char x; float y; double h;} xy;void main(){ printf("struct a: %d /n",原创 2010-01-14 09:27:00 · 1143 阅读 · 0 评论 -
C++const用法浅析
Const用法浅析 1. const修饰普通变量和指针const修饰变量,一般有两种写法:const TYPE value;TYPE const value;这两种写法在本质上是一样的。它的含义是:const修饰的类型为TYPE的变量value是不可变的。对于一个非指针的类型TYPE,无论怎么写,都是一个含义,即value只不可变。例如:const int nValue;原创 2010-01-07 16:49:00 · 6399 阅读 · 0 评论 -
Six BS HelloWorld From C World
#define _________ } #define ________ putchar #define _______ main #define _(a) ________(a); #define ______ _______(){ #define __ ______ _(0x48)_(0x65)_(0x6C)_(0x6C) #define ___ _(0x6F)_(0x2C)_(0x原创 2010-01-08 09:23:00 · 670 阅读 · 0 评论 -
C代码混淆之旅
从天堂走向地狱的六部... 1第一步、把for变成while. 2第二步,把循坏变成递归... 2第三步,弄乱代码结构/使用没有含义的变量名... 3第四步,取消临时变量... 3第五步,继续弄乱变量名... 4第六步,移除常量... 4 从天堂走向地狱的六部开始程序下面是一个找出素数的程序: 查看源代码打印帮助void primes(int c原创 2010-01-08 09:46:00 · 1411 阅读 · 0 评论 -
C++设计开发规范
C++设计开发规范 1. 引言... 21.1. 核心价值... 21.2. 参考... 21.3. 约定... 21.4. 基本术语... 22.命名规范... 22.1. 大小写约定... 32.2. 通用命名约定... 32.3. 名字空间的命名... 42.4. 类型(类、结构、接口、枚举、typedef)的原创 2010-01-14 09:47:00 · 1190 阅读 · 0 评论 -
有关友元的一点运用
/*一个类A声明为一个类B的友元类之后,类A就可以任意访问类B的所有成员(公有的、保护的和私有的)。但是,如果一个类D继承自类B,类B中的友元关系并不会被继承,也就是说,类A是类B的友元但却不是类B的派生类D的友元。即类A不可以访问类D的保护的和私有的成员。在上面的代码中,被注释了的部分不能够通过编译,因为D不是A的友元类,B的友元关系并没有被继承。而在A的Print函数成原创 2010-01-14 11:40:00 · 609 阅读 · 1 评论 -
C++ Standard Library
The C++ standard library provides a set of common classes and interfaces that greatly extend the core C++ language. The library, however, is not self-explanatory. To make full use of its components - and to benefit from their power - you need a resource th原创 2010-06-17 17:15:00 · 1147 阅读 · 0 评论 -
迷宫算法
<br />Here is a simple implementation for maze issue.#include <stdio.h><br />#include <stdlib.h><br />#include <stdext.h><br />#include <stdbool.h><br />#define ROW_NUM 8<br />#define COL_NUM 8<br /><br />typedef struct {<br /> int x;<br /> int y;<br原创 2010-10-08 11:06:00 · 817 阅读 · 0 评论 -
Eclipse下利用VC编译器编写C/C++程序
安装eclipse-cpp-galileo-win32.zip以下是最新eclipse cpp 开发IDEhttp://www.eclipse.org/downloads/download.php?file=/technology/epp/downloads/release/galileo/SR1/eclipse-cpp-galileo-SR1-win32.zip 设置make程序原创 2009-12-31 10:14:00 · 8302 阅读 · 4 评论 -
堆和栈的区别
堆和栈的区别 一、预备知识—程序的内存分配 一个由C/C++编译的程序占用的内存分为以下几个部分 1、栈区(stack)— 由编译器自动分配释放 ,存放函数的参数值,局部变量的值等。其 操作方式类似于数据结构中的栈。 2、堆区(heap) — 一般由程序员分配释放, 若程序员不释放,程序结束时可能由OS回 收 。注意它与数据结构中的堆是两回事,分配方式倒是类似于链表,呵呵。 3、全局区(静态区)(转载 2010-03-16 12:24:00 · 639 阅读 · 0 评论 -
C++类型字节大小
C++类型字节大小class A{ }; int main(){ coutsizeof(char)endl; //1字节 coutsizeof(short)endl; //2字节 coutsizeof(unsigned short)endl;//2字节 coutsizeof(signed原创 2010-01-14 14:04:00 · 860 阅读 · 0 评论 -
C++ Coding Note
// Test.cpp : Defines the entry point for the console application.// #include "stdafx.h"class A{public: void doit(){std::coutprotected:private:};class B : public virtual A{原创 2010-01-13 11:11:00 · 622 阅读 · 0 评论 -
C++类模板的三种特化
http://www.cppblog.com/SmartPtr/archive/2007/07/04/27496.aspx原创 2010-01-21 09:07:00 · 622 阅读 · 0 评论 -
用EditPlus配置VC环境(VC8)
http://www.cppblog.com/SmartPtr/archive/2009/05/09/30886.html#82363原创 2010-01-21 09:10:00 · 601 阅读 · 0 评论 -
Autodesk面试技术题解答
http://www.cppblog.com/SmartPtr/archive/2007/08/17/30231.aspx原创 2010-01-21 09:12:00 · 686 阅读 · 0 评论 -
C++调用JAVA方法详解
http://public0821.javaeye.com/blog/423941 C++调用JAVA主要用到了SUN公司的JNI技术, JNI是Java Native Interface的 缩写。从Java 1.1开始,Java Native Interface (JNI)标准成为java平台的一部分,它允许Java代码和其他语言写的代码进行交互。相关资料见http://java.sun原创 2010-01-28 12:16:00 · 578 阅读 · 0 评论 -
深入学习C语言知识点
http://topic.csdn.net/u/20091027/22/0573cfb5-f1bf-4cf2-8e60-13d907301a8e.html?26259 字符串 学习时间:1.5W(“W”周,下同) 知识点checklist strlen()函数的返回值是什么类型的? 字符串strlen()的值,是否和他占据的内存空间相同? 你是转载 2010-03-06 22:44:00 · 886 阅读 · 0 评论 -
C++静态成员函数
C++静态成员函数小结一 静态数据成员... 11.静态数据成员的定义... 12.静态数据成员被 类 的所有对象所共享(包括该类派生类的对象)... 23.静态数原创 2009-12-31 09:46:00 · 1578 阅读 · 5 评论 -
xxx
JonsenElizeeSoftware Developing Blog"An idea is fragile . It can be killed by a scornful smile or a yawn .It can be mound down by irony and scared to death by a cold look.""Most cultures thr原创 2012-09-25 22:48:29 · 7758 阅读 · 0 评论