User Profile

Collapse

Profile Sidebar

Collapse
IgorXX
IgorXX
Last Activity: Jun 4 '13, 01:57 PM
Joined: May 30 '13
Location:
  •  
  • Time
  • Show
  • Source
Clear All
new posts

  • Oralloy

    Notes on my last reply:
    1. Much earlier in our conversation, I had incorrectly defined rise_fall as
    char *rise_fall = '\0';
    It should have been
    char rise_fall = '\0';
    2. My last sentence beginning with "Alas I rue having" should have read "Alas I rue not having".

    Having abruptly awoken at 2 AM with drool running down the side of my mouth by...
    See more | Go to post

    Leave a comment:


  • Oralloy,

    I will have to wait until maybe Wednesday before working on this nay more as Micsoroft has been trying to clear up my machine (Trojans and a trashed regisrty file among other things). Their server was up and down today so they couldn't finish. Now must "wait til the morrow". The mention of FORTRAN brings back memories to an old, toothless programmer. It was the first language I learned, even before proper English....
    See more | Go to post

    Leave a comment:


  • Oralloy

    Thanks again. At your suggestion, I used error checking. The output lines below are from a debug display using printf("[%s][%s][%s][%s][%s][%s][%s][%c][%s]\n" . The brackets clearly show what is assigned to each variable.

    Your suggested format string "%15c%8c%4c%4c% 4c%10c%6c%1c%[^]" works better but gives:
    [ELLINGTON FLD ][PTSUNNY ][ 90][ 75][ 62][ SW10G18 ][ 29.94][ ][]
    ...
    See more | Go to post

    Leave a comment:


  • Oralloy,

    Thanks for your help. I must really be missing something. Have worked the format string down to

    "%15[^]%8[^]%8[^]%4[^]%4s%6s%16s%8c%[^]"

    with the folowing results:

    [ELLINGTON FLD ][PTSUNNY ][90][75][62][ SW10G18][][ ][]
    [*ZAPATA ][SUNNY ][99][61][28][ SE13G20][][ ][]
    [FORT STOCKTON ][SUNNY ][102][-17][1][ SW24G30][][ ][]
    [GUYMON ...
    See more | Go to post

    Leave a comment:


  • Using sscanf() to parse a buffer string containing multiple fixed-length sub-strings

    I used the %Width[^]s format specifier, in which "Width" specifies the maximum number of characters to be read for the value of the associated variable. It does not appear to work properly or it is incorrect.


    Code:
    char inbuf[128] = "\0";            //input string just read from infile
    char obs_sta[32] = "\0";           //name of observation station
    char sky_wx[16] = "\0";
    ...
    See more | Go to post
    Last edited by Rabbit; May 30 '13, 10:12 PM. Reason: Please use code tags when posting code.
No activity results to display
Show More
Working...