home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #19 / NN_1992_19.iso / spool / comp / lang / c / 12902 < prev    next >
Encoding:
Text File  |  1992-08-27  |  1.4 KB  |  39 lines

  1. Newsgroups: comp.lang.c
  2. Path: sparky!uunet!munnari.oz.au!uniwa!cujo!lillee!chans
  3. From: chans@lillee.cs.curtin.edu.au (Sean Chan)
  4. Subject: fscanf problem...
  5. Message-ID: <chans.714976579@lillee>
  6. Sender: news@cujo.curtin.edu.au (News Manager)
  7. Organization: Curtin University of Technology
  8. Date: Fri, 28 Aug 1992 04:36:19 GMT
  9. Lines: 28
  10.  
  11. Gidday all,
  12.  
  13. I am trying to read a file containing a 2x2 dim array of integers. The
  14. numbers are indented in the file...
  15.  
  16. eg.
  17.      2   2   2   1   20   30   40   70... and so on...
  18.  
  19. I'm trying to get fscanf to read each integer at a time but I get a core
  20. dump. It's used like this :-
  21.  
  22.       fscanf (infile, "%d", val);
  23.  
  24. Any reason why I'm getting a core dump?? Doesn't fscanf automatically
  25. skip the spaces and read the integers only??
  26.  
  27. Sean
  28. ***********************************************************************
  29. *                             *                            *
  30. * Sean Chan                         *   Inside every microchip   *
  31. * Student Number : 892561F             *   there is a little man    *
  32. * 3rd Yr. Computer Science             *   running around doing     *
  33. * Curtin University of Technology        *   everything you have      *
  34. *                                        *   asked him to do...       *
  35. * E-Mail : chans@marsh.cs.curtin.edu.au     *                            *
  36. *          pchans@cc.curtin.edu.au     ******************************
  37. *                         *
  38. ******************************************
  39.