To all who know C++,
Im working on a prog that will be able to predict the weather, its too
complicated to go into here, but I do need some help.
I need to grab all of the information in the file currdat.lst that is in
quotes and store them in variables. Sounds simple enough, right? This area
of my prog. is complete garbage, so I wont bother to post it.
For anyone interested in helping, the next line is line one of
currdat.lst
[header]
programm_name = "heavy weather"
programm_versio n = "Ver. 2.0 beta release"
file_name = "currdat.ls t"
file_format_ver sion = "ver. 1.0"
[time]
start = 3315854779
start_date_stri ng = "Thu Jan 27 17:46:19 2005"
last_actualisat ion = 3315855694
last_actualisat ion_date_string = "Thu Jan 27 18:01:34 2005"
next_actualisat ion = 3315855754
next_actualisat ion_date_string = "Thu Jan 27 18:02:34 2005"
[weather_picture]
comment = "-1=not valid, 0=rain, 1=cloud, 2=sun"
number = 1
[weather_tendenc y]
comment_1 = "-1=not valid, 0=no change of air pressure"
comment_2 = " 1=air pressure rising, 2=air pressure falling"
number = 0
[indoor_temperat ure]
deg_C = "20.2"
deg_F = "68.3"
[outdoor_tempera ture]
deg_C = "-15.8"
deg_F = "3.5"
[indoor_humidity]
percent = "43"
[outdoor_humidit y]
percent = "19"
[dewpoint]
deg_C = "OFL"
deg_F = "OFL"
[windchill]
deg_C = "-15.8"
deg_F = "3.5"
[wind_speed]
mps = "0.0"
kmh = "0.0"
mph = "0.0"
knt = "0.0"
bft = " 0"
[wind_direction]
deg = "22.5"
name = "NNE"
[rain_total]
mm = "0.0"
inch = "0.00"
[rain_24h]
mm = "0.0"
inch = "0.00"
[rain_1h]
mm = "0.0"
inch = "0.00"
[pressure_absolu te]
hpa = "1017.5"
inHg = "30.04"
[pressure_relati ve]
hpa = "2748.1"
inHg = "81.15"
[storm_alarm]
comment = "-1=not valid, 0=storm alarm not activ, 1=storm alarm activ"
number = 0 3 2535
On Mon, 21 Feb 2005 16:10:49 -0500, "JamesLomus cio"
<ja***********@ aol.com> wrote in comp.lang.c++: To all who know C++,
Im working on a prog that will be able to predict the weather, its too complicated to go into here, but I do need some help.
We'll be glad to help.
I need to grab all of the information in the file currdat.lst that is in quotes and store them in variables. Sounds simple enough, right? This area of my prog. is complete garbage, so I wont bother to post it.
If you don't show us your code, how can you expect us to offer you
advice on correcting it?
For anyone interested in helping, the next line is line one of
More than a few here would be interested in helping, but probably none
interested in writing your code for you.
currdat.lst [header] programm_name = "heavy weather" programm_versio n = "Ver. 2.0 beta release" file_name = "currdat.ls t" file_format_ver sion = "ver. 1.0"
[snip]
--
Jack Klein
Home: http://JK-Technology.Com
FAQs for
comp.lang.c http://www.eskimo.com/~scs/C-faq/top.html
comp.lang.c++ http://www.parashift.com/c++-faq-lite/
alt.comp.lang.l earn.c-c++ http://www.contrib.andrew.cmu.edu/~a...FAQ-acllc.html
On Mon, 21 Feb 2005 16:10:49 -0500, JamesLomuscio <ja***********@ aol.com>
wrote: To all who know C++,
Im working on a prog that will be able to predict the weather, its too complicated to go into here, but I do need some help.
I need to grab all of the information in the file currdat.lst that is in quotes and store them in variables. Sounds simple enough, right? This area of my prog. is complete garbage, so I wont bother to post it.
For anyone interested in helping, the next line is line one of currdat.lst [header] programm_name = "heavy weather" programm_versio n = "Ver. 2.0 beta release" file_name = "currdat.ls t" file_format_ver sion = "ver. 1.0"
[...]
where is the problem?
use std::ifstream, getline(), and parse the strings / lines you get.
for parsing, you may want to use the various std::string::fi nd*()
methods...
"JamesLomus cio" <ja***********@ aol.com> wrote in message
news:1b******** *************** *******@localho st.talkaboutpro gramming.com... To all who know C++,
Im working on a prog that will be able to predict the weather, its too complicated to go into here, but I do need some help.
That's a pretty lofty goal! Especially considering that the most powerful
computers in the world are used for such tasks, and the code for such has
been developed over decades of painstaking research and analysis.
I need to grab all of the information in the file currdat.lst that is in quotes and store them in variables. Sounds simple enough, right? This area of my prog. is complete garbage, so I wont bother to post it.
Are you on the Windows platform? That data looks just like an INI file to
me. If so, there is functionality in the Windows API (and in the Visual C++
libs) specifically for reading INI files. If that's your platform+compil er,
check the VC+ docs or the Windows API docs, or ask in a windows-related
newsgroup. That'll probably be easier than writing the parsing code
yourself.
But if you want help with the parsing code, you need to make a stab at it
yourself, and come back here if/when you have language-related issues with
what you've written. If the code is complete garbage, then you probably
need to re-design it entirely, and then re-write it. Look into streams.
There are many examples of reading from streams which you can find via a
search of groups.google.c om. (We're certainnly not going to re-write your
non-posted, garbage code for you!)
-Howard This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
by: news.microsoft.com |
last post by:
In my engineering class we're discussing microprocessor branch predictors.
Is it possible to write a Windows application (anything whatsoever) that
would allow me see how branch prediction is done in C# or if it implements
some type of Branch Target Buffer?
Any help would be appreciated.
Thanks.
|
by: sduncansca |
last post by:
Hello
We have been using the the National Weather Service
webservice(http://www.weather.gov/xml/) for a while. A couple weeks ago they
made some changes and moved the url of the
wsdl(http://www.weather.gov/forecasts/xml/DWMLgen/wsdl/ndfdXML.wsdl).
I changed the wsdl location in my project and refreshed the web references,
but now I am...
|
by: Neal |
last post by:
VC++
VS 2003
I am currently finishing up a weather bug program that receives data from
the weather.com weather feed, just need some finishing touches. The one
issue I have run into seems to be a simple one in the grand scheme of things.
How do I go about printing a degree symbol for the temperature? Is there an
ASCII code for it, or some...
|
by: Boki |
last post by:
Hi All,
I am going to create a personal weather board.
It is easy to show the picutre on website ( just link the picture to
picturesbox's properties )
but I dont' know how to add some other text near by..
for example:
|
by: pmclinn |
last post by:
I have the xml feed belowfrom this link:
http://www.weather.gov/alerts/ct.rss
I for the life of me can not get this data to format in a html table
using client side scripting. Any help would be much appreciated.
<?xml version="1.0" encoding="UTF-8" ?>
- <rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/">
- <channel>...
| |
by: jimb |
last post by:
Looking for a simple view on the weather. Just learning the xml stuff.
I would like to add to the the weather.com icon. Any help is
appreciated.
<html>
<head>
<body bgcolor="#000000" text="#FFFFFF">
<p class=MsoNormal><o:p></o:p><span
style='font-size:288.0pt;font-family:Arial'>
|
by: dawnrager |
last post by:
Hi, everyone. I'm having a really difficult time pasting in generated code from the Weather Channel for a weather sticker for my webpage. This was the code sent to me via email:
<!-- cut and paste the below code into your HTML editor --><div id="wx_module_2384"> <a href="http://www.weather.com/weather/local/15904">Johnstown, PA (15904)...
|
by: Jake G |
last post by:
Hi all,
I am trying to get a current weather conditions feed working. Yahoo
provides a free feed @ http://weather.yahooapis.com/forecastrss?p=XXXXX
where XXXXX is a valid US zip code
e.g. (http://weather.yahooapis.com/forecastrss?p=43221)
The feed is documented @ http://developer.yahoo.com/weather/
This works fine. Where I run into...
|
by: sandeep patil |
last post by:
how to diplay the weather condiction on my webpage
suppose i want to read weather from www.bbc.co.uk/weather.html
how i can read it usin program
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it.
First, let's disable language...
| |
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed.
This is as boiled down as I can make it. ...
|
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
|
by: TSSRALBI |
last post by:
Hello
I'm a network technician in training and I need your help.
I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs.
The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols.
I succeeded, with both firewalls in...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
| |
by: bsmnconsultancy |
last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...
| |