| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 883 人关注过本帖
标题:[求助][讨论]vc++
只看楼主 加入收藏
zhaoke85
Rank: 1
等 级:新手上路
帖 子:2
专家分:0
注 册:2005-3-7
收藏
 问题点数:0 回复次数:2 
[求助][讨论]vc++
#include<stdlib.h>
#include<iostream.h>
class calculation
{
public:
 void add();
 void sub();
 void mul();
 void div();
 void setxy(double x1,double y1);
privte:
double x,y;
}
 void main (int argc,char *argv[])
  void (calculation::*pfun)();
 cslculation call;
 if (argc!=4)
 {
  cout<<"ERROR!!"<<endl;
  cout<<usage:for example:cal 3 + 5"<<endl;
   return;
 }
 switch (srgv[2][0])]
 {case '+': pfun=calculation::add;
 break;
 case '-': pfun=calculation::sub;
  break;
 case '*': pfun=calculation::mul;
  break;
 case '/': pfun=calculation::dir;
  break;
 default: {cout<<"operator is error!";
  return;
    }
 }
 call setxy(atof(argv[1],atof(argv[3]));
 call *pfun();
 void calculation::add()
 {cout<<"x="<<x<<"y="<<y<<"\t\tx+y="<<x+y<<endl;
 }
 void calculation::sub;
 {cout<<"x="<<x<<"y="<<y<<"\t\tx+y="<<x+y<<endl;
 }
 void calculation::mul;
 {cout<<"x="<<x<<"y="<<y<<"\t\tx+y="<<x+y<<endl;
 }
 void calculation::dir;
 {cout<<"x="<<x<<"y="<<y<<"\t\tx+y="<<x+y<<endl;
 }
 void calculation::setxy(double x1, double y1)
 {x=x1;
 y=y1;
 }

看看有什么问题 拜托拜托..............
搜索更多相关主题的帖子: break pfun double calculation void 
2005-03-07 17:05
cexoss2349
Rank: 1
等 级:新手上路
帖 子:8
专家分:0
注 册:2005-3-16
收藏
得分:0 
這麼長?看不懂........
2005-03-17 14:04
terran
Rank: 1
等 级:新手上路
帖 子:17
专家分:0
注 册:2005-3-17
收藏
得分:0 
用C编的哦~看不懂

2005-03-18 13:07
快速回复:[求助][讨论]vc++
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.014305 second(s), 8 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved