🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: borland.public.csharpbuilder.aspdotnet.general
3 messages
3 total messages Started by Ramtin Sat, 26 Feb 2005 01:46
how Initializing string arrays ?
#33
Author: Ramtin
Date: Sat, 26 Feb 2005 01:46
6 lines
1077 bytes
Hi
CSharp doesnot allow Initializing string array in classes.
1. How can I have consts or functions without to have a class?
2. How can I initialize string arrays ?

K.Ramtin
Re: how Initializing string arrays ?
#34
Author: Marc Rohloff TeamB
Date: Sat, 26 Feb 2005 03:12
12 lines
1607 bytes
On Sat, 26 Feb 2005 05:16:49 +0330, Ramtin wrote:

> 1. How can I have consts or functions without to have a class?
You can't. You can however define a method as 'static' in which case
you don't need an instance of the class.

> 2. How can I initialize string arrays ?
static readonly string[] s = new string[] {"a", "b"};

-- 
Marc Rohloff [TeamB]
marc rohloff -at- myrealbox -dot- com
Re: how Initializing string arrays ?
#35
Author: Ramtin
Date: Mon, 28 Feb 2005 21:37
1 lines
958 bytes
Thanks Marc !
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads