how to save data in array permenantly

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • christine0207
    New Member
    • Aug 2006
    • 9

    how to save data in array permenantly

    pls help.. i have no idea how to save data in array permentantly..
  • Banfa
    Recognized Expert Expert
    • Feb 2006
    • 9067

    #2
    Write it to a file, look you the functions

    fopen
    fclose
    fread
    fwrite
    fgets
    fputs
    fgetc
    fputc
    fprintf
    fscanf <-- but don't use this function

    Comment

    • sundarr
      New Member
      • Aug 2006
      • 9

      #3
      Hi All,

      Any array can be defined permanently by adding a "const" intializer to the array.

      For example a sample array would look like...

      const unsigned int A[5] = {1,2,3,4};

      Similar consts can also be used for other data tyoes as well. A good suggestion would bt to go thru YashWant Kanetkars "Let Us C" which goes through these details ina very simple language.

      I hope i hve made things simplr.

      Comment

      Working...