Click here to Skip to main content
15,907,183 members
Home / Discussions / C#
   

C#

 
QuestionInstantiate Array of User defined type Pin
kildareflare27-Jul-07 1:36
kildareflare27-Jul-07 1:36 
AnswerRe: Instantiate Array of User defined type Pin
Pete O'Hanlon27-Jul-07 1:56
mvePete O'Hanlon27-Jul-07 1:56 
GeneralRe: Instantiate Array of User defined type Pin
kildareflare27-Jul-07 23:46
kildareflare27-Jul-07 23:46 
GeneralRe: Instantiate Array of User defined type Pin
PaulPrice29-Jul-07 21:04
PaulPrice29-Jul-07 21:04 
AnswerRe: Instantiate Array of User defined type [modified] Pin
PaulPrice27-Jul-07 2:53
PaulPrice27-Jul-07 2:53 
GeneralRe: Instantiate Array of User defined type Pin
leppie27-Jul-07 3:07
leppie27-Jul-07 3:07 
GeneralRe: Instantiate Array of User defined type Pin
kildareflare28-Jul-07 23:44
kildareflare28-Jul-07 23:44 
GeneralRe: Instantiate Array of User defined type Pin
PaulPrice29-Jul-07 21:10
PaulPrice29-Jul-07 21:10 
I think you have missed my point!

An array in .NET is nothing like C++ or VB.

It is an Array object, a collection, NOT a series of memory locations initialised as a standard array.

I would suggest you do some more reading regarding collections, it is pretty important.

But to give you a head start, when you create an array here, you are actually creating a list of reference variables, and not that actual objects themselves, so, you will still need to call new on each location!

For example

<br />
cInput[] bInputs;<br />
bInputs = new cInput[2];<br />
<br />
for(int i = 0; i < bInputs.Length; i++)<br />
{<br />
   bInputs[i] = new cInput();<br />
   bInputs[i].m_SetState(true); <br />
}<br />


I would also suggest hwever, that if you are using .NET 2.0 or newer, look at and learn generics (again, look at the collections)

Paul.
QuestionHow to retrieve local settings Pin
Stevo Z27-Jul-07 1:18
Stevo Z27-Jul-07 1:18 
AnswerRe: How to retrieve local settings Pin
Eduard Keilholz27-Jul-07 1:21
Eduard Keilholz27-Jul-07 1:21 
GeneralRe: How to retrieve local settings Pin
Stevo Z27-Jul-07 1:22
Stevo Z27-Jul-07 1:22 
QuestionDatagrid row selection Pin
Nisar Inamdar27-Jul-07 0:53
Nisar Inamdar27-Jul-07 0:53 
QuestionDataGridViewCell Pin
sangramkp27-Jul-07 0:36
sangramkp27-Jul-07 0:36 
AnswerRe: DataGridViewCell Pin
Chetan Patel27-Jul-07 1:07
Chetan Patel27-Jul-07 1:07 
QuestionHow to prioritize the UI thread as a process (.exe) eats up the resources Pin
Rafferty Uy27-Jul-07 0:26
Rafferty Uy27-Jul-07 0:26 
AnswerRe: How to prioritize the UI thread as a process (.exe) eats up the resources Pin
Martin#27-Jul-07 0:36
Martin#27-Jul-07 0:36 
AnswerRe: How to prioritize the UI thread as a process (.exe) eats up the resources Pin
Mike Dimmick27-Jul-07 2:22
Mike Dimmick27-Jul-07 2:22 
QuestionHow to convert Struct to array Pin
kobi10i1027-Jul-07 0:13
kobi10i1027-Jul-07 0:13 
AnswerRe: How to convert Struct to array Pin
Christian Graus27-Jul-07 0:28
protectorChristian Graus27-Jul-07 0:28 
AnswerRe: How to convert Struct to array Pin
Guffa27-Jul-07 2:36
Guffa27-Jul-07 2:36 
AnswerRe: How to convert Struct to array Pin
leppie27-Jul-07 3:16
leppie27-Jul-07 3:16 
AnswerRe: How to convert Struct to array Pin
CiNN27-Jul-07 5:39
CiNN27-Jul-07 5:39 
QuestionHow to give attechment with mailto in c# Pin
Dhaval Bhattji26-Jul-07 23:58
Dhaval Bhattji26-Jul-07 23:58 
AnswerRe: How to give attechment with mailto in c# Pin
Christian Graus27-Jul-07 0:30
protectorChristian Graus27-Jul-07 0:30 
QuestionProblem in Deployment of Excel Data Reading WebPart developed in C# Pin
khan SharePoint Developer26-Jul-07 23:45
khan SharePoint Developer26-Jul-07 23:45 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.