Jump to content

  • Log In with Google      Sign In   
  • Create Account


- - - - -

First chapter done.


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
2 replies to this topic

#1 Durfy   Members   -  Reputation: 109

Like
0Likes
Like

Posted 08 August 2007 - 05:31 AM

Yeah I signed up but I've been so busy until recently. I finally got through the first chapter. I have to say that C# looks like a pretty impressive language. I have a few questions though ( I come from C++(intermediate) ) I dont quite understand interfaces. Say I have
interface i {
  void SetColor(Color color);
}

and I implement it in a class like so class Ball : i does that mean that Ball must contain the method SetColor with the same signature? also if interface has a member(variable) would that mean that Ball will inherit that? The other subject I was completely lost on is delegates. Should I just read more and eventually I'll learn, or should I understand the basic concept at this point. (it mentioned C++ function pointers but i'm lost there too) Thanks for your time, -durfy

Sponsor:

#2 Telastyn   Crossbones+   -  Reputation: 3726

Like
0Likes
Like

Posted 08 August 2007 - 05:39 AM

Quote:
Original post by Durfy
does that mean that Ball must contain the method SetColor with the same signature?


Yes, or compiler error.

Quote:

also if interface has a member(variable) would that mean that Ball will inherit that?


Interfaces may not contain member variables.

Quote:

The other subject I was completely lost on is delegates. Should I just read more and eventually I'll learn, or should I understand the basic concept at this point. (it mentioned C++ function pointers but i'm lost there too)


If you're not familiar with C++ function pointers then you should read more. If you are, then in C# the delegate keyword acts as a C++ typedef for a function pointer. That may then be used to declare and use delegate objects which are more like C++ function pointers, only less icky.



#3 Durfy   Members   -  Reputation: 109

Like
0Likes
Like

Posted 08 August 2007 - 05:42 AM

Thanks a lot dude.
I will keep reading.
Hopefully I will power through a couple chapters and catch up.
Thanks,
-durfy




Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS