Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Newby Question
Message
 
To
08/10/2004 21:30:12
General information
Forum:
ASP.NET
Category:
Other
Title:
Miscellaneous
Thread ID:
00950103
Message ID:
00950108
Views:
18
Ok, I'm sort there in this.

I have a new CSharp book, which I'm going through. Some of it is
high & wide to me, but I understand most of the examples, with
exceptions noted here. Talking theory to me is ok, but seeing
code samples really works.

I took a Visual C++ class many, many moons ago, so it's like
dusting off the cobwebs here.

Next questions:

In this next code snippet, I understand the concept of
interfaces, and a sample from the book is pasted here.

The parameter statements are giving me trouble.

What's the byte[ ]? This is an array of bytes?

And, the out byte[ ] outbuff is throwing me also.
interface iSecret
  {
    void Encrypt(byte[ ] inbuf, out byte[ ] outbuff, Key key);
    void Unecrypt(byte[ ] inbuf, out byte[ ] outbuff, Key key);
  }
Many thanks





>Kevin,
>
>First of all, just because code compiles cleanly, doesn't mean it'll run the way you want it to. <g>
>
>The first line you have a question on is the namespace line? What is a namespace and why do you need it? This is pretty rudimentary concept. Here's one blurb I found in the docs concerning namespaces.
>
>Every component is contained within a namespace. By default, the namespace
> is the name of your project.  Users of your component assembly will add
> Imports (Visual Basic) or using (C#) statements for the namespaces
>containing components they want to access.
>
>Generally speaking, the structure of namespaces in your component assembly
> should reflect its internal organization. If your assembly contains a
>large number of components, it makes sense to group related components in
>separate namespaces.
>
>So, for example, I have a DataAccess class. It's namespace might be something like this:
>
>namespace MyCompany.DataAccess.Customers
>
>The second line that you have a question on (again, from the docs, or simply by hovering your mouse cursor over it <g>).
>
>		[STAThread]
>Indicates that the COM threading model for an application is single-
>threaded apartment (STA).
>
>Notice that this is prior to your "static void Main(string[] args)" ... this is the entry-point into your application and is necessary so that the app has a starting point when running.
>
>~~Bonnie
>
>
>
>>I have stupid newby quesstions about this c# code. See inline
>>questions.
>>
>>using System;
>>
>>**** The code compiles fine without this. What is it and why
>>**** do I need it
>>
>>namespace ConsoleApplication1
>>{
>>	/// <summary>
>>	/// Summary description for Class1.
>>	/// </summary>
>>	class Class1
>>	{
>>		/// <summary>
>>		/// The main entry point for the application.
>>		/// </summary>
>>
>>
>>**** Same with this line. Compliles fine without this
>>		[STAThread]
>>		static void Main(string[] args)
>>		{
>>			//
>>			// TODO: Add code to start application here
>>			//
>>		}
>>	}
>>}
>>
Everything makes sense in someone's mind
public class SystemCrasher :ICrashable
In addition, an integer field is not for irrational people
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform