如何在点结构的构造函数中使用double值? [英] How to use double values in the constructor of point structure ?
本文介绍了如何在点结构的构造函数中使用double值?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我想通过为点结构的x和y参数提供double值来创建点结构。单个构造函数不支持这一点。那么,怎么做?
我想实现,
Hi,
I want to create a point structure by supplying double values to the x and y parameters of a point structure.Not a single constructor supports this. so, how to do this?
I want to achieve,
double x;
double y;
Point p1 = new Point(x, y);
但不幸的是我无法得到它。
我的尝试:
我做了谷歌搜索&发现此链接与我的问题。据此,我添加了对WindowsBase.dll的引用,但无法通过using语句包含它。请帮助我。
But unfortunately I couldn't get it.
What I have tried:
I did google search & found This link relevant to my question. As per that, I added reference to WindowsBase.dll but couldn't be able to include it by using statement. Please,help me.
推荐答案
在System.Windows中使用
而不是。它的构造函数接受Point
类double
参数。
这篇关于如何在点结构的构造函数中使用double值?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文