472,339 Members | 1,719 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,339 software developers and data experts.

Poblem with Structural array

Hey, I am trying to declare an array of 12 structs that will hold information from a file input.

I have my struct

Expand|Select|Wrap|Line Numbers
  2. struct month
  3. {
  4.     float totalRain, highTemp, lowTemp, averageTemp;
  5. };

and this is my array

Expand|Select|Wrap|Line Numbers
  1. struct month fullYear[12];
These are my struct variables.

Expand|Select|Wrap|Line Numbers
  1. month jan, feb, mar, april, may, june, jul, aug, sept, oct, nov, dec;

each of the struct variables will be placed in the array respectively, but I am unsure how to read the information from the file putting them in their rightfull place.

The values in the input file will be separated by blanks. A sample single line in the input file might be:
20.1 78.2 40.1

How would I go about placing 20.1 into jan.totalRain in my array?

I hope I explained myself clearly, If not just let me know.

Thank you all for your help in advance.
Sep 3 '07 #1
1 1151
3,652 Expert 2GB
Access jan by using month[0], feb with month[1], ... dec with month[11]. For your operations, instead of typing jan.totalRain = /* your code here */;, type month[0].totalRain = /* your code here */;
Sep 3 '07 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

by: Brian | last post by:
I'm diddlying with a script, and found some behavior I don't understand. Take this snippet: for ($i = 0; $i <= count($m); $i++) {...
by: Stormkid | last post by:
Hi Group I'm trying to figure out a way that I can take two (two dimensional) arrays and avShed and shed, and subtract the matching elements in...
by: LC | last post by:
hi, i worry about people doing something they shouldn't to my db and I would like to track any structural changes (who and which)to my db. I am...
by: davidrubin | last post by:
Structural inheritance (inheriting implementation) is equivalent to composition in that a particular method must either call 'Base::foo' or invoke...
by: adam.spamfree | last post by:
Hi, I was just wondering if anyone could give me an explanation of what the difference between "structural" and "presentational" elements is....
by: Mike McGavin | last post by:
Hi everyone. I'm searching for a quick and dirty way to have psql record the SQL statements that I enter, especially those related to the...
by: Hans | last post by:
In developer studio 2003, I created a solution containing a C# windows app. I want to re-engeneer the app using Visio Professional 2003. How can...
by: Graville | last post by:
All, OK wasn't sure where to post this one but this should hopefully be ok. I am looking for a way to streamline some of the process within our...
by: mikek12004 | last post by:
Initialy i wanted to create a short description of a text to be shown as preview, I found the following which worked OK $length = 35; // The...
by: concettolabs | last post by:
In today's business world, businesses are increasingly turning to PowerApps to develop custom business applications. PowerApps is a powerful tool...
by: teenabhardwaj | last post by:
How would one discover a valid source for learning news, comfort, and help for engineering designs? Covering through piles of books takes a lot of...
by: CD Tom | last post by:
This only shows up in access runtime. When a user select a report from my report menu when they close the report they get a menu I've called Add-ins...
by: Naresh1 | last post by:
What is WebLogic Admin Training? WebLogic Admin Training is a specialized program designed to equip individuals with the skills and knowledge...
by: jalbright99669 | last post by:
Am having a bit of a time with URL Rewrite. I need to incorporate http to https redirect with a reverse proxy. I have the URL Rewrite rules made...
by: antdb | last post by:
Ⅰ. Advantage of AntDB: hyper-convergence + streaming processing engine In the overall architecture, a new "hyper-convergence" concept was...
by: Matthew3360 | last post by:
Hi, I have a python app that i want to be able to get variables from a php page on my webserver. My python app is on my computer. How would I make it...
by: Arjunsri | last post by:
I have a Redshift database that I need to use as an import data source. I have configured the DSN connection using the server, port, database, and...
by: WisdomUfot | last post by:
It's an interesting question you've got about how Gmail hides the HTTP referrer when a link in an email is clicked. While I don't have the specific...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.