Date.h:::
#ifndef DATE_CLASS
#define DATE_CLASS
#include <iostream>
#include <string>
using namespace std;
class Date {
private:
int year, month, day;
private:
enum {……继续阅读 »
10年前 (2015-11-16) 1446浏览
0个赞
#include<iostream>
using namespace std;
int main()
{
long* pt = new long;
long sum = 0;
cout << “请输入数字:”;
cin >> pt[0];
for (int i = 0; pt[i] != 0;)
……继续阅读 »
10年前 (2015-11-16) 2546浏览
0个赞
例如这样:
#define STR "is a %s"
...
printf("This "STR" !!!!", " str");
上面这种写法在VS2008里面可以正常编译,但是在g++ 4.4.7中,报错:error: expected ‘)’ before STR
问一下linux下面该怎么写呢?谢谢
解决方案:10分
解决方案:10分
呵……继续阅读 »
10年前 (2015-11-16) 2830浏览
1个赞
代码如下:::
std::for_each(w, w + 4,std::mem_fun_ref(&Worker::Print));
错误信息如下:::
错误 1 error C2064: 项不会计算为接受 1 个参数的函数 d:\visual studio 2010\安装目录\vc\include\algorithm 22
解决方案:7分
1)自……继续阅读 »
10年前 (2015-11-16) 1099浏览
0个赞
#include<iostream>
#include<cstring>
using namespace std;
class CStudent
{
public:
CStudent(char *n, int a);
~CStudent();
friend class CTeacher;
private:
……继续阅读 »
10年前 (2015-11-16) 1044浏览
0个赞
实际上都是为了偷懒
例如有如下的类
class MyStruct
{
public:
void fun();
};
MyStruct *ptr = new MyStruct;
ptr->fun();
想法就是: 有这样一个智能指针, 实现, 在执行ptr->fun();的时候, 自动执行假如为空中, 则不调用fun(……继续阅读 »
10年前 (2015-11-16) 1263浏览
0个赞
给定一个二维数组int t[m][n],其中m和n千万级别,且t中没有任何的规律(如有序等)。有什么好的办法,在不用多线程等技术的前提下高效的实现?
解决方案:2分
用文件当数组使用吧
解决方案:5分
没有规律,你还是要遍历一遍的。
解决方案:2分
英雄所见略同!
解决方案:10分
// 创建文件句柄
HANDLE hFile = ::C……继续阅读 »
10年前 (2015-11-16) 1161浏览
0个赞
在绘图时本人想将坐标轴设置x轴向右 y轴向上 z轴垂直于屏幕,
用了如下语句
CView::OnPrepareDC(pDC, pInfo);
CRect rect;
GetClientRect(rect);
pDC->SetMapMode(MM_HIMETRIC);
pDC->SetViewportOrg(rect.right/14,5*r……继续阅读 »
10年前 (2015-11-16) 1753浏览
0个赞
# include <stdio.h>
# include <malloc.h>
# include <stdlib.h>
typedef struct Node
{
int data;
struct Node * pNext;
}NODE, *PNODE;
PNODE create_list(void);
void t……继续阅读 »
10年前 (2015-11-16) 1043浏览
0个赞