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
plot_arr.cpp
Upload User: dq031136
Upload Date: 2022-08-08
Package Size: 802k
Code Size: 1k
Category:
Visual C++ Books
Development Platform:
C++ Builder
- #include <iostream.h>
- #include <strstrea.h>
- const int size = 5;
- class plot
- {
- int x, y;
- public:
- plot(int i, int j)
- {
- if(i>size)
- i = size;
- if(i<0)
- i = 0;
- if(j>size)
- j = size;
- if(j<0)
- j=0;
- x=i;
- y=j;
- }
- friend ostream &operator<<(ostream &stream, plot obj);
- };
- ostream &operator<<(ostream & stream, plot obj)
- {
- register int i, j;
- for(j=size; j>=0; j--)
- {
- stream << j;
- if(j==obj.y)
- {
- for(i=0; i<obj.x; i++)
- stream << " ";
- stream << '*';
- }
- stream << endl;
- }
- for(i=0; i<=size; i++)
- stream << " " << i;
- stream << endl;
- return stream;
- }
- void main(void)
- {
- plot a(2,3), b(1,1);
- char str[200];
- cout << "Output using cout:" << endl;
- cout << a << endl << b << endl << endl;
- ostrstream outs(str, sizeof(str));
- outs << a << b << ends;
- cout << "output using in-RAM formatting:" << endl;
- cout << str;
- }