Wrox Programmer Forums
Go Back   Wrox Programmer Forums > C# and C > C# 1.0 > C#
|
C# Programming questions specific to the Microsoft C# language. See also the forum Beginning Visual C# to discuss that specific Wrox book and code.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the C# section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old April 2nd, 2007, 04:12 PM
Authorized User
 
Join Date: Jan 2007
Posts: 27
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to seymour_glass
Default arrays of structs

I need to enter data for 14 people with 3 fields of data for each. I have made my struct, and declared my array. I am, however, a little confused about where to start with "parsing" the fields from my textbox to my array..

array[1].personsName = whatever.TextBox.Text...

is something like that correct? How far off am i?


Seymour
 
Old April 2nd, 2007, 05:53 PM
planoie's Avatar
Friend of Wrox
 
Join Date: Aug 2003
Posts: 5,407
Thanks: 0
Thanked 16 Times in 16 Posts
Default

That looks reasonable to me.

Have you tried it yet?

-Peter
 
Old April 2nd, 2007, 08:14 PM
Authorized User
 
Join Date: Jan 2007
Posts: 27
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to seymour_glass
Default

Yes. I get a problem between converting the int to a string...

also it occurred i am going to need an index for which array i am on. something like:

                        if (householdIndex < 15)
            {
                incomeSurvey[householdIndex].intIdNum;
            }

also i understand i would be incrementing householdIndex after each field has been saved for the array as i move to the next set of records..





Similar Threads
Thread Thread Starter Forum Replies Last Post
Enums VS Structs MoDulus Intro Programming 4 January 19th, 2012 10:42 AM
SizeOf Structs CDMBR C# 1 February 21st, 2007 06:24 PM
declaring structs scoobie C++ Programming 3 April 6th, 2006 12:44 AM
structs - read in from data. mclavo Visual C++ 0 October 25th, 2004 10:49 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.