随笔分类 - 我的C++学习之路
2012-10-11
摘要:http://www.jb51.net/article/32616.htm
阅读全文
摘要:在win32控制台调试如下程序#include "stdafx.h"#include //#include //using namespace std;int _tmain(int argc, _TCHAR* argv[]){CString str;int a,b; /* CStdioFile fBio;fBio.Open(LPCTSTR("FBio.Dat"),CFile::modeCreate|CFile::modeWrite|CFile::typeText);a=b=1;cout::Format(const wchar_t *,...)”: 不能将
阅读全文
摘要:#include "stdafx.h"#include #include #include #include using namespace std;class Student{public:Student(){}Student(string name,string sex,int age,string number);int getAge(){return _age;} string getNumber(){return _number;}bool operator==(const string&str)//重载操作符{ return str==_number;}
阅读全文
摘要:原文出自【比特网】,转载请保留原文链接:http://soft.chinabyte.com/database/460/11433960.sh[导读] ofstream是从内存到硬盘,ifstream是从硬盘到内存,其实所谓的流缓冲就是内存空间 在C++中,有一个stream这个类,所有的I/O都以这个“流”类为基础的,包括我们要认识的文件I/O. stream这个类有两个重要的运算符: 1、插入器(>) 从流中输入数据。比如说系统有一个默认的标准输入流(cin),一般情况下就是指的键盘,所以,cin>>x;就表示从标准输入流中读取一个指定类型的数据。 在C++中,对文件的操作
阅读全文
摘要:source code:base class:class persion {protected:string _name,_sex,_birthday,_number;int _age;public:persion(string st_name,string st_sex,string st_birthday,int st_age,string st_number);persion(){}virtual bool SearchData(string studentnumber,string name)=0;void DisplayData();};derived class:class Stu
阅读全文
摘要:#include "stdafx.h"#include using namespace std;class Screen{friend istream&operator>>(istream&,Screen&);friend ostream&operator_height||col_width){cerr"; osHeight()|| s1.Width()!=s2->Width()) return false; for(int ix=0;ixWidth();jy++) if (s1.get(ix,jy)!=s2-&g
阅读全文
摘要:// MyClient.cpp : 定义控制台应用程序的入口点。//#include "stdafx.h"#include "stdio.h"#include "Winsock2.h"#include "conio.h"#include "stdlib.h"#pragma comment(lib,"ws2_32.lib")void BeginSend(char *sendBuf){WORD wVersionRequested;WSADATA wsaData;int err;w
阅读全文
摘要:// MyFirst.cpp : 定义控制台应用程序的入口点。//#include "stdafx.h"#include "Winsock2.h"#pragma comment(lib,"ws2_32.lib")int _tmain(int argc, _TCHAR* argv[]){ WORD wVersionRequested;WSADATA wsaData;int err;wVersionRequested = MAKEWORD(1,1);err = WSAStartup(wVersionRequested,&wsaDa
阅读全文
摘要:// 629.cpp : 定义控制台应用程序的入口点。//#include "stdafx.h"//#include class Point{public:void OutPut(){int a=2;printf("Please output a integer:\n");printf("%d",a);scanf("%d",&a);}void f(){ /* int a; scanf("%d",&a); if(a==1) { char s[5]={'a','
阅读全文
摘要:http://www.ed2000.com/ShowFile.asp?FileID=259370
阅读全文
摘要:if(name.Compare("sFormat")==0){sFormat = value;prt.SetManualSize(atoi(ssDirection[atoi(sFormat)-1]), atoi(ssPaperwidth[atoi(sFormat)-1]), atoi(ssPaperheight[atoi(sFormat)-1]));writelog("调用的是SetManualSize", "c:\\1.log"); writelog( (char*)(LPCTSTR)(ssPaperwidth[atoi(sForm
阅读全文
摘要:Visual C++6.0是开发Windows应用程序的强大工具,但是要通过它实现程序的打印功能,一直是初学者的一个难点,经常有朋友询问如何在VC中实现打印功能,他们往往感到在MFC提供的框架内实现这个问题很复杂,不知道如何下手。本例针对这个问题,介绍一种简单的方法实现文字串的打印功能,读者朋友可以在此基础上稍微改动一下,就可以实现文件、图像的打印功能。 一、实现方法 在Windows操作系统下,显示器、打印机和绘图仪都被视为输出设备,正常情况下,系统默认的输出设备是显示器。要使用打印机,首先需要创建一个指向打印机的设备环境句柄,然后通过该句柄调用相关的绘图函数把所需的文字和图形输出至打印..
阅读全文
摘要:sockets(套接字)编程有三种,流式套接字(SOCK_STREAM),数据报套接字(SOCK_DGRAM),原始套接字(SOCK_RAW);基于TCP的socket编程是采用的流式套接字。服务器端编程的步骤:1:加载套接字库,创建套接字(WSAStartup()/socket());2:绑定套接字到一个IP地址和一个端口上(bind());3:将套接字设置为监听模式等待连接请求(listen());4:请求到来后,接受连接请求,返回一个新的对应于此次连接的套接字(accept());5:用返回的套接字和客户端进行通信(send()/recv());6:返回,等待另一连接请求;7:关闭套接字
阅读全文
摘要:比如我想输入break,在输入b的时候系统自动提示头字母为b的关键字。下载Visual assist Xhttp://www.skycn.com/soft/11952.html
阅读全文

浙公网安备 33010602011771号