VB  
Dim fno  as string 
Dim F_Name As String
Dim sno As Long
Dim aa() As Long
1: fno = FreeFile();
2: Open F_Name For Binary Access Read As #fno
3: Len(sno)
4: ReDim aa(ll - 1)
5: Get #fno, , aa
6: Dim aa() As Long
7: Seek #fno, Seek(fno) - (gbuff.nSize - sno)
以上七点在VC6.0该用什么样的语句才能正确的表示!
拜托!

解决方案 »

  1.   

    1.Dim fno  as string 
    in vc: TCHAR fno[256]; //在c\c++里的字符串必须给出长度,不过你也可以用stl或别的库,他们提供了字符串对象,例如:
    #include <string>
    using namespace std;
    ...
    ..
    string fno;
    ..
    ..3. Dim sno As Long
    in vc: long sno;不知道vb里的freefile有什么用`不过想在c++里做文件操作也方便``看这里:
    http://blog.csdn.net/phonelear/archive/2004/10/14/136690.aspx
      

  2.   

    #include <stdio.h>void main( void )
    {
       FILE *stream;
       char line[81];
       int  result;   stream = fopen( "fseek.out", "w+" );
       if( stream == NULL )
          printf( "The file fseek.out was not opened\n" );
       else
       {
          fprintf( stream, "The fseek begins here: "
                           "This is the file 'fseek.out'.\n" );
          result = fseek( stream, 23L, SEEK_SET);
          if( result )
             perror( "Fseek failed" );
          else
          {
             printf( "File pointer is set to middle of first line.\n" );
             fgets( line, 80, stream );
             printf( "%s", line );      }
          fclose( stream );
       }
    }
      

  3.   

    发错了.上面定义的 Dim fno  as string 应该改为 Dim fno 
      

  4.   

    "r"Opens for reading. If the file does not exist or cannot be found, the fopen call fails."w"Opens an empty file for writing. If the given file exists, its contents are destroyed."a"Opens for writing at the end of the file (appending) without removing the EOF er before writing new data to the file; creates the file first if it doesn’t exist."r+"Opens for both reading and writing. (The file must exist.)"w+"Opens an empty file for both reading and writing. If the given file exists, its contents are destroyed."a+"Opens for reading and appending; the appending operation includes the removal of the EOF er before new data is written to the file and the EOF er is restored after writing is complete; creates the file first if it doesn’t exist.