Click here to Skip to main content
16,006,378 members
Home / Discussions / C#
   

C#

 
GeneralRe: Create Rule in runtime mode Pin
Not Active25-Mar-08 10:37
mentorNot Active25-Mar-08 10:37 
GeneralRe: Create Rule in runtime mode Pin
Pete O'Hanlon25-Mar-08 11:28
mvePete O'Hanlon25-Mar-08 11:28 
GeneralRe: Create Rule in runtime mode Pin
cocoonwls25-Mar-08 17:00
cocoonwls25-Mar-08 17:00 
GeneralRe: Create Rule in runtime mode Pin
Pete O'Hanlon25-Mar-08 22:48
mvePete O'Hanlon25-Mar-08 22:48 
GeneralPassing an array of struct Pin
Jerry Graham25-Mar-08 7:48
Jerry Graham25-Mar-08 7:48 
GeneralRe: Passing an array of struct Pin
Gareth H25-Mar-08 7:52
Gareth H25-Mar-08 7:52 
GeneralRe: Passing an array of struct Pin
Jerry Graham25-Mar-08 9:00
Jerry Graham25-Mar-08 9:00 
GeneralRe: Passing an array of struct [modified] Pin
Gareth H25-Mar-08 9:07
Gareth H25-Mar-08 9:07 
Jerry Graham,

In your code, you only create an array, you dont create any instances. So, you need to do:

friendType myFriend = new friendType();
myFriend.name = "bob";

friends[i] = myFriend;


On a side note, i'd personnly change your array to a generic list. eg:

List-friendType- friendArray = new List-friendType-;


(Change the "-" to "<" and ">", it wouldnt let me add them, guess CP doesnt allow for naughty HTML to be inserted)

This is because as you create the array, you set its size to be 10, now if you always populate that array with 10 friends, then its fine. But what if you want 11, your array doesn't handle that or if you only have 9 friends, then you have a null item. Just a tip.

Also, its a good idea to follow the standard naming convention.

http://msdn2.microsoft.com/en-us/library/ms229045.aspx[^]

Regards,
Gareth.

modified on Tuesday, March 25, 2008 3:17 PM

GeneralRe: Passing an array of struct Pin
Jerry Graham25-Mar-08 9:36
Jerry Graham25-Mar-08 9:36 
GeneralRe: Passing an array of struct Pin
Jerry Graham25-Mar-08 10:58
Jerry Graham25-Mar-08 10:58 
GeneralRe: Passing an array of struct Pin
Guffa25-Mar-08 23:16
Guffa25-Mar-08 23:16 
GeneralRe: Passing an array of struct Pin
Jerry Graham26-Mar-08 13:27
Jerry Graham26-Mar-08 13:27 
GeneralRe: Passing an array of struct Pin
Guffa26-Mar-08 14:42
Guffa26-Mar-08 14:42 
GeneralAuthenticating Against Active Directory in Web App. Pin
dboy22125-Mar-08 7:44
dboy22125-Mar-08 7:44 
General***HELP** Get value from one of the following - Datalist/GridView/Repeater/Formview etc Pin
DoubleDiamond25-Mar-08 7:22
DoubleDiamond25-Mar-08 7:22 
GeneralRe: ***HELP** Get value from one of the following - Datalist/GridView/Repeater/Formview etc Pin
Christian Graus25-Mar-08 10:21
protectorChristian Graus25-Mar-08 10:21 
GeneralRe: ***HELP** Get value from one of the following - Datalist/GridView/Repeater/Formview etc Pin
DoubleDiamond25-Mar-08 10:57
DoubleDiamond25-Mar-08 10:57 
GeneralRe: ***HELP** Get value from one of the following - Datalist/GridView/Repeater/Formview etc Pin
Christian Graus25-Mar-08 11:02
protectorChristian Graus25-Mar-08 11:02 
GeneralRe: ***HELP** Get value from one of the following - Datalist/GridView/Repeater/Formview etc Pin
DoubleDiamond25-Mar-08 11:24
DoubleDiamond25-Mar-08 11:24 
GeneralRe: ***HELP** Get value from one of the following - Datalist/GridView/Repeater/Formview etc Pin
Christian Graus25-Mar-08 11:42
protectorChristian Graus25-Mar-08 11:42 
AnswerRe: ***HELP** Get value from one of the following - Datalist/GridView/Repeater/Formview etc Pin
DoubleDiamond25-Mar-08 12:50
DoubleDiamond25-Mar-08 12:50 
QuestionHttpWebRequest : get all sub request of a particular URL Pin
Baro25-Mar-08 7:15
Baro25-Mar-08 7:15 
GeneralRe: HttpWebRequest : get all sub request of a particular URL Pin
K.L.K7-Apr-08 14:37
K.L.K7-Apr-08 14:37 
GeneralEnvironment.Exit(); Pin
Harvey Saayman25-Mar-08 6:32
Harvey Saayman25-Mar-08 6:32 
GeneralRe: Environment.Exit(); Pin
J4amieC25-Mar-08 6:47
J4amieC25-Mar-08 6:47 

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.