thanks for the help
On 10 יולי, 09:48, Jay Dan wrote:
> using System;
> using System.Collections.Generic;
> using System.Text;
>
> namespace ConsoleApplication1
> {
>
> struct Complex
> {
> double r;
> double i;
> public Complex(double rt, double it)
> {
>
Please study my code segment i have created one single page for
demonstration.
· Regarding the error - Static member...cannot be accessed with an
instance reference-
You have declared your member methods as static and static methods are only
accesable using class names not class instance.
using System;
using System.Collections.Generic;
using System.Text;
namespace ConsoleApplication1
{
struct Complex
{
double r;
double i;
public Complex(double rt, double it)
{
r = rt;
i = it;
}
public static void print
i added this code
class MainClass
{
static void Main(string[] args)
{
Complex num1 = new Complex(2,3);
Complex num2 = new Complex(9,4);
Complex sum = new Complex(12,3);
What errors are you getting?
On Thu, Jul 9, 2009 at 4:42 PM, thread wrote:
>
> hello all,
> i'm trying to use this code in MainClass but nothing works:
>struct Complex
>{
>double r;
>double i;
>public Complex(double rt,double it)
>