473,785 Members | 2,639 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

A question about definition and declaration

Hello!

I'm reading in a book and they use definition sometimes and declaration
sometimes.
I just want to use the correct terminologi when I talk about these kind of
things.

Below is an example from a book.
The two rows that begin with public delegate void...
and
public event MoveRequest ...
what is each one according to you. Is it a definition or declaration?

class GameController
{
public delegate void MoveRequest(obj ect sender, MoveRequestEven tArgs e);
public event MoveRequest OnMoveRequest;
.... ... ...
}

//Tony
Dec 1 '07 #1
4 1214
Tony Johansson <jo************ *****@telia.com wrote:
I'm reading in a book and they use definition sometimes and declaration
sometimes.
I just want to use the correct terminologi when I talk about these kind of
things.

Below is an example from a book.
The two rows that begin with public delegate void...
and
public event MoveRequest ...
what is each one according to you. Is it a definition or declaration?
They're both declarations. One is a delegate type declaration, and the
other is an event declaration.

--
Jon Skeet - <sk***@pobox.co m>
http://www.pobox.com/~skeet Blog: http://www.msmvps.com/jon.skeet
World class .NET training in the UK: http://iterativetraining.co.uk
Dec 1 '07 #2
These terms are synonymous.

--
--
Bob Powell [MVP]
Visual C#, System.Drawing

Ramuseco Limited .NET consulting
http://www.ramuseco.com

Find great Windows Forms articles in Windows Forms Tips and Tricks
http://www.bobpowell.net/tipstricks.htm

Answer those GDI+ questions with the GDI+ FAQ
http://www.bobpowell.net/faqmain.htm

All new articles provide code in C# and VB.NET.
Subscribe to the RSS feeds provided and never miss a new article.
"Tony Johansson" <jo************ *****@telia.com wrote in message
news:Wj******** ********@newsb. telia.net...
Hello!

I'm reading in a book and they use definition sometimes and declaration
sometimes.
I just want to use the correct terminologi when I talk about these kind of
things.

Below is an example from a book.
The two rows that begin with public delegate void...
and
public event MoveRequest ...
what is each one according to you. Is it a definition or declaration?

class GameController
{
public delegate void MoveRequest(obj ect sender, MoveRequestEven tArgs e);
public event MoveRequest OnMoveRequest;
... ... ...
}

//Tony

Dec 2 '07 #3

-----Original Message-----
From: Bob Powell [MVP] [mailto:bo*@spam killerbobpowell .net]
Posted At: Sunday, 2 December 2007 10:20 AM
Posted To: microsoft.publi c.dotnet.langua ges.csharp
Conversation: A question about definition and declaration
Subject: Re: A question about definition and declaration

These terms are synonymous.

--
--
Bob Powell [MVP]
Visual C#, System.Drawing
To clarify Bob's statement, these terms are synonymous in Visual C#.
Some other languages, for example, C and C++, have difference between
Definition and Declaration.

Dec 3 '07 #4
Hello,
These terms are synonymous.
Even for Partial Methods?

(H) Serge
Dec 4 '07 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

8
2460
by: newmans | last post by:
Perhaps one of the experts can straighten me out on this point... In Bjarne Stroustrup's book 'The C++ Programming Language' 3rd Edition, section 4.9, indicates that typedef complex<short> Point; is not only a declaration, but also a definition. The ISO/IEC 14882:2003(E) standard states in section 3.1 clause 2 that
19
2919
by: J. J. Farrell | last post by:
After many years of dealing with definition and linkage issues in ways that I know to be safe, I've decided it's time to try to understand this area properly. Consider a header file with the file scope declaration int i; This header is included in two files that refer to i but do not declare it. The two files build together into a single program.
13
2097
by: fctk | last post by:
source: http://rm-f.net/~orange/devel/specifications/c89-draft.html#3.1.2.2 there are two passages in this paragraph i can't fully understand: 1) "If the declaration of an identifier for an object or a function contains the storage-class specifier extern , the identifier has the same linkage as any visible declaration of the identifier with file scope. If there is no visible declaration with file scope, the identifier has external...
30
3356
by: questions? | last post by:
say I have a structure which have an array inside. e.g. struct random_struct{ char name; int month; } if the array is not intialized by me, in a sense after I allocated a
75
5482
by: Steven T. Hatton | last post by:
No, this is not a troll, and I am not promoting Java, C-flat, D, APL, Bash, Mathematica, SML, or LISP. A college teacher recently posted to this newsgroup regarding her observation that there has been a significant decline in the number of students opting to take courses in C++. I just want to let people know what I believe are the biggest obstacles to C++ language acquisition, and what aspects of the language make it less appealing than...
9
8895
by: Jess | last post by:
Hello, I was told that if I declare a static class constant like this: class A{ static const int x = 10; }; then the above statement is a declaration rather than a definition. As I've *defined* "x"'s value to be 10, isn't above statement a
15
14916
by: vaib | last post by:
hi to all.i'd like to know the actual difference between variable declaration and definition.it would be very helpful if anyone out there wud help me out with this thing.i'm writing here after here after a long time since people here also helped me out with my lexer. thanking in anticipation.
16
1551
by: Haskell Prelude | last post by:
Hello Friends - Can anyone answer these C questions? 1. What is the effect of making an internal (local) variable static? 2. What is the effect of making an external (non-local) variable static? 3. What, possibly including garbage, is output by the following code? int a = 10; int b = 12;
5
1938
by: gw7rib | last post by:
I was having linking errors when I put: const LPCTSTR Main_window_name = _TEXT("Thingy_main_window"); in one file and extern const LPCTSTR Main_window_name; in another. I've since realised that this is because (in C++) consts do not, by default, have external linkage. I've solved the problem by
0
9645
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9481
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10155
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10095
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9953
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
5383
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5513
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4054
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3655
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.