首页 技术 正文
技术 2022年11月15日
0 收藏 312 点赞 4,614 浏览 771 个字
using namespace std;
class Point
{
public:
double x;
double y;
Point(){}
void setPoint(double x,double y )
{
this->x = x;
this->y = y;
}
Point(double xx,double yy)
{
this->x=xx;
this->y=yy;
}
};
class Point1
{
public:
Point point;
void set()
{
point.x=;
point.y=;
cout<<point.x<<point.y<<endl;
}
};class Point2
{
public:
Point point;
void set(Point point)
{
point.x=;
point.y=;
cout<<point.x<<point.y<<endl;
}
};
class Point3
{
public:
Point point;
void set(Point &point)
{
point.x=;
point.y=;
cout<<point.x<<point.y<<endl;
}
};int main(int argc,char *argv[])
{
Point1 point1;
point1.set();
cout<<point1.point.x<<point1.point.y<<endl;
Point2 point2;
point2.set(point2.point);
cout<<point2.point.x<<point2.point.y<<endl;
Point3 point3;
point3.set(point3.point);
cout<<point3.point.x<<point3.point.y<<endl;
return ;
}

基础:c++中引用与java中的引用

基础:c++中引用与java中的引用

c++中要想让内部操作印象到外部,需要使用引用或者指针。

java中将摒弃指针,全部使用引用进行操作。

相关推荐
python开发_常用的python模块及安装方法
adodb:我们领导推荐的数据库连接组件bsddb3:BerkeleyDB的连接组件Cheetah-1.0:我比较喜欢这个版本的cheeta…
日期:2022-11-24 点赞:878 阅读:9,119
Educational Codeforces Round 11 C. Hard Process 二分
C. Hard Process题目连接:http://www.codeforces.com/contest/660/problem/CDes…
日期:2022-11-24 点赞:807 阅读:5,591
下载Ubuntn 17.04 内核源代码
zengkefu@server1:/usr/src$ uname -aLinux server1 4.10.0-19-generic #21…
日期:2022-11-24 点赞:569 阅读:6,436
可用Active Desktop Calendar V7.86 注册码序列号
可用Active Desktop Calendar V7.86 注册码序列号Name: www.greendown.cn Code: &nb…
日期:2022-11-24 点赞:733 阅读:6,207
Android调用系统相机、自定义相机、处理大图片
Android调用系统相机和自定义相机实例本博文主要是介绍了android上使用相机进行拍照并显示的两种方式,并且由于涉及到要把拍到的照片显…
日期:2022-11-24 点赞:512 阅读:7,843
Struts的使用
一、Struts2的获取  Struts的官方网站为:http://struts.apache.org/  下载完Struts2的jar包,…
日期:2022-11-24 点赞:671 阅读:4,928