TListBox and arrays

Last updated 1995.03.05


Version
None specified
Terms
TListBox; TNSCollection::insert; ::newStr; arrays
   // From file:
   FILE *f;
   char buf[80];
   int n, cnt=0;
   while (fgets(buf,80,f))
      // could use strdup()?       
      collection->insert(newStr(buf));

   while (fread(&n,2,1,f))
   {
      sprintf(buf,"Counter %u = %u",cnt++,n);
      collection->insert(newStr(buf));
   }
   // From array is similar

Comment: There may be difficulty reading streamable file from other language programs.