- 博客(29)
- 资源 (9)
- 收藏
- 关注
原创 VC++新建选择卡的解释
新建选项卡一::Active Server Page 活动服务器页Binary File 二进制文件Bitmap File 位图文件C/C++ Header File C/C++头文件C++ Source File C++源文件Cursor File 光标文件HTML File HTML文件Icon File 图标文件Macro File 宏文件Resource Script 资源
2009-10-29 09:26:00 599
原创 宏判断类是否定义
#ifndef ANIMAL_H_H#define ANIMAL_H_Hclass Animal{public: Animal(int height,int weight); void eat(); void sleep(); virtual void breathe();};#endif
2009-10-26 16:22:00 958
原创 桶子算法
#include using namespace std;int main(){ int lsd,i,j,k,n; n=1; k=0; int str[10]={91,20,33,45,6,87,7,3,55,15}; int temp[10][10]={0}; int order[10]={0}; cout for (i=0;i { cout } cout while (n {
2009-10-26 12:50:00 443
原创 找最多0
#include void main(){int i,j,m,n,t,s,l;int ch[3][5]={1,1,0,0,0,1,1,1,0,1,1,0,0,1,1};int w[3];for (i=0;i{m=0;for (j=0;j{if (ch[i][j]==0){++m;}}w[i]=m;}for (t=0;t{for (n=0;n{if (w[n]{s=w[n];w[n]=w[n+1
2009-10-26 10:38:00 415
原创 去掉二维数组重复值[算法]
#include void main(){ int i,j,m=0,w,n,t; int ch[3][5]={ 2,1,3,4,1, 6,7,8,9,10, 11,12,1,13,1 }; int*a=new int[18]; for (i=0;i { for (j=0;j { a[m] = ch[i][j]; m++; } } for (j=0;j { for (i
2009-10-26 09:31:00 791
原创 字符串位置查询
#include using namespace std;int Length(char ch[]){ int i=0; while(ch[i]!=/0){i++;} return i;}int Fink(char ch[],char c){ for (int i=0;i { if (ch[i]==c) { break; } } return i+1;}void main(){ ch
2009-10-24 09:43:00 777
原创 合并字符
#include using namespace std;int Length(char ch[]){ int i=0; while (ch[i]!=/0){i++;} return i;}char *Link(char ch1[],char ch2[]){ int s1=Length(ch1),s2=Length(ch2); char*p=new char[s1+s2+1]; for (in
2009-10-23 16:12:00 441
原创 右截取
#include using namespace std;char *str_right(char [],int);int str_check(char []);void main(){ char ch[]="sqlserver"; char*p=str_right(ch,5); cout}int str_check(char ch[]){ int sum=0; for (int m=0;ch[m
2009-10-23 11:25:00 583
原创 隐藏ie地址栏
function sms( aobj, flag){try{var width = 470;var height = 392;var left = ( screen.width - width ) / 2;var top = ( screen.height - height ) / 2;var href = aobj.href;var param = resizable=0, scrollb
2009-10-22 08:36:00 768
原创 JS控制图片大小
var flag=false; //控制小图function DrawImage(ImgD,maxwidth,maxheight){ var image=new Image(); image.src=ImgD.src; if(image.width>0 && image.height>0){ flag=true; if(image.width/ima
2009-10-22 08:36:00 805
原创 string型字符串
1::char和string比较#include #include using namespace std;int main(){ string str="string类型字符串"; char ch[]="char型字符串"; cout cout cout cin>>str; if (str=="dog") { cout cout } else { cout } cout cin>>ch
2009-10-21 15:17:00 1434
原创 char型字符串
#include using namespace std;int main(){ /*例一:: char man[12]; cin.get(man,12); 保存12-1个字符,第12位为/0,结束符 空格ASCII为:32 空字符ASCII为:0 cout */ /*例二:: char man[]={a,32,b,/0}; 不加/0算是数组,加了算是字符串.
2009-10-21 14:43:00 606
原创 类的函数指针
一::#include using namespace std;class A{public: void Set(int x,int y){a=x;b=y;} void Show(){coutprivate: int a; int b;};void (A::*p)(int,int);/*类的成员函数指针*/int main(){ A a; p=&A::Set; int x=2,y=3; (a.
2009-10-21 10:24:00 563
原创 使用typedef简化函数指针的声明
#include using namespace std;void square(float&x,float&y){x=x*x;y=y*y;}void cube(float&x,float&y){x=x*x*x;y=y*y*y;}typedef void (*p)(float&,float&);void print(p vp,float&x,float&y)//用指针p声明出来一个vp{ cout
2009-10-21 10:03:00 589
原创 函数指针也可作为函数的参数
#include using namespace std;void square(float&x,float&y){x=x*x;y=y*y;}void cube(float&x,float&y){x=x*x*x;y=y*y*y;}void print(void (*p)(float&,float&),float&x,float&y){ cout cout p(x,y); cout cout}voi
2009-10-21 09:33:00 414
原创 函数指针数组
#include using namespace std;void (*p[5])(int&,int&);//全局的.void square(float&x,float&y){x=x*x;y=y*y;}void cube(float&x,float&y){x=x*x*x;y=y*y*y;}void print(float&x,float&y){coutvoid Swap(float&x,float
2009-10-21 09:18:00 417
原创 函数指针
#include #include using namespace std;/*int(*func)(int);long(*func1)(int); //声明了一个指针.该指针指向一个函数.long *func1(int); //声明了一个函数.该函数返回一个指针.*/float (*fp)(float&,float&);void (*p)(float&,float&);float triang
2009-10-20 16:37:00 378
原创 静态成员的使用
#include using namespace std;class aspl{public: aspl(float p){price=p;TotalPrice=TotalPrice+p;} ~aspl(){TotalPrice=TotalPrice-price;} static float get(){return TotalPrice;}private: float price; static
2009-10-20 15:44:00 438
原创 静态成员函数
#include using namespace std;class A{public: void static show(){cout void get(){cout/* 类中任何成员函数都能访问静态成员 静态成员函数不能直接访问非静态成员 静态成员函数不能被说明为虚函数*/private: static int n; int m;};class B:public A{ };int A::n=0
2009-10-20 15:28:00 398
原创 私有静态成员变量
#include using namespace std;class A{public: void Func(){coutprivate: static int x;};int A::x=1000;int main(){ A a; a.Func(); /*静态私有成员.访问的前提.必须有该类的对象A a;a.Func();*/ return 0;}
2009-10-20 14:59:00 939
原创 静态成员变量
#include using namespace std;class A{public: A(int num):it(num){total++;} static int total; virtual ~A(){total--;} int get(){return it;} void set(int age){it=age;}private: int it;};int A::total=0;void
2009-10-20 14:52:00 746
原创 抽象类实例
#include using namespace std;class Shape{public: virtual double area()=0;};/*三角形类*/class Trigon:public Shape{protected: double h,w;public: Trigon(double H,double W) { h=H; w=W; } double area() { r
2009-10-20 13:49:00 655
原创 纯虚函数与抽象类
#include using namespace std;class Human//接口类ADT{public: Human(){cout virtual void smart()=0; //纯虚函数. virtual void beautiful()=0; //纯虚函数. virtual ~Human(){cout};class father:virtual public Hum
2009-10-20 13:00:00 497
原创 模拟抽象类
#include using namespace std;class Human//接口类ADT{public: Human(){cout virtual void smart(){} virtual void beautiful(){} virtual ~Human(){cout};class father:virtual public Human{public: father(){cout v
2009-10-20 11:18:00 515
原创 多重继承
#include using namespace std;class father{public: father(){cout void smart(){cout virtual ~father(){cout};class mother{public: mother(){cout virtual void beautiful(){cout virtual ~mother(){cout};class
2009-10-20 10:58:00 393
原创 在派生类中增加函数
#include using namespace std;class father{public: void smart(){cout //virtual void beautiful(){} virtual ~father(){cout};class son:public father{public: void beautiful(){cout ~son(){cout};int main(){
2009-10-20 10:46:00 618
原创 多重继承
#include using namespace std;class father{public: void smart(){cout virtual void beautiful(){} virtual ~father(){cout};class son:public father{public: void beautiful(){cout ~son(){cout};int main(){ fa
2009-10-20 10:33:00 457
原创 走迷宫
// GameWnd.cpp : implementation file////#include "stdafx.h"#include "game.h"#include "GameWnd.h"#ifdef _DEBUG#define new DEBUG_NEW#undef THIS_FILEstatic char THIS_FILE[] = __FILE__;#endif///////
2009-10-20 10:10:00 856
原创 C++键盘事件
VK_A~VK_Z从A键到Z键.VK_0~VK_9从0键到9键.VK_F1~VK_F12从F1键到F12键.VK_DOWN向下键头VK_UP向上键头VK_LEFT向左键头VK_RIGHT向右键头VK_ESCAPE::ESC键VK_DELETE::DELETE键VK_INSERT::INSERT键VK_SHIFT::SHIFT键VK_CONTROL::CT
2009-10-19 15:52:00 7382
Wrox.-.Beginning.Php,.Apache,.Mysql.Web.Development.(2004)
2011-05-25
比较不错的Flex 教程
2010-05-19
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人