Code/Resource
Windows Develop
Linux-Unix program
Internet-Socket-Network
Web Server
Browser Client
Ftp Server
Ftp Client
Browser Plugins
Proxy Server
Email Server
Email Client
WEB Mail
Firewall-Security
Telnet Server
Telnet Client
ICQ-IM-Chat
Search Engine
Sniffer Package capture
Remote Control
xml-soap-webservice
P2P
WEB(ASP,PHP,...)
TCP/IP Stack
SNMP
Grid Computing
SilverLight
DNS
Cluster Service
Network Security
Communication-Mobile
Game Program
Editor
Multimedia program
Graph program
Compiler program
Compress-Decompress algrithms
Crypt_Decrypt algrithms
Mathimatics-Numerical algorithms
MultiLanguage
Disk/Storage
Java Develop
assembly language
Applications
Other systems
Database system
Embeded-SCM Develop
FlashMX/Flex
source in ebook
Delphi VCL
OS Develop
MiddleWare
MPI
MacOS develop
LabView
ELanguage
Software/Tools
E-Books
Artical/Document
CHAPTER1-17.cpp
Package: c++stl程序员开发指南.rar [view]
Upload User: fjc899
Upload Date: 2007-07-03
Package Size: 187k
Code Size: 1k
Category:
STL
Development Platform:
C/C++
- //文件名:CHAPTER1-17.cpp
- #include<iostream.h>
- #include<stdio.h>
- #include<string.h>
- class Demo
- {
- int l;
- char *p;
- public:
- Demo(const char *s)
- {
- l=strlen(s);
- p=new char[l+1];
- strcpy(p,s);
- }
- Demo()
- {
- p=new char[8];
- cout<<"****n";
- } /*不会自动执行*/
- void show()
- {
- printf("%x ,%x:%s",&l,p,p);
- }/*显示l、p的地址和p内的字符串*/
- ~Demo(){delete p;}
- };
- void main()
- {
- Demo h("first");
- Demo r=h; /*希望将对象h的全部成员数据内容复制到对象r内*/
- r.show();
- h.show();
- }