Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/csharp/296.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C#相当于C++;ostream::tellp用于软盘的大小限制 是否存在C++的StreamWriter流的C等价物:Telp?我正在把一些旧的C++代码移植到C语言,但是客户端仍然想要使用磁盘(读:旧设备),所以我需要找到一种方法来找到文件指针位置或者找到我已经写了多少磁盘。_C#_C++_Streamwriter_Ostream - Fatal编程技术网

C#相当于C++;ostream::tellp用于软盘的大小限制 是否存在C++的StreamWriter流的C等价物:Telp?我正在把一些旧的C++代码移植到C语言,但是客户端仍然想要使用磁盘(读:旧设备),所以我需要找到一种方法来找到文件指针位置或者找到我已经写了多少磁盘。

C#相当于C++;ostream::tellp用于软盘的大小限制 是否存在C++的StreamWriter流的C等价物:Telp?我正在把一些旧的C++代码移植到C语言,但是客户端仍然想要使用磁盘(读:旧设备),所以我需要找到一种方法来找到文件指针位置或者找到我已经写了多少磁盘。,c#,c++,streamwriter,ostream,C#,C++,Streamwriter,Ostream,以下是我迄今为止创建的方法: private bool isDisketteBoundary(ref StreamWriter swOutput, int nCurrentDisketteNo) { // Get current file pointer position // long filePosition = nOStream.tellp(); <-- C++ code long filePosition = 0; // <-- need

以下是我迄今为止创建的方法:

 private bool isDisketteBoundary(ref StreamWriter swOutput, int nCurrentDisketteNo) {
      // Get current file pointer position
      // long filePosition = nOStream.tellp(); <-- C++ code
      long filePosition = 0; // <-- needs to change to find file pointer position

      // Valid?
      if(filePosition != -1) {
           // Is the new size over a boundary?
           float numDiskettes = (float)((float)filePosition / (float)Constants.DisketteSize);
           int disketteCount = Convert.ToInt32(Math.Ceiling(numDiskettes));

           // Is the diskette count larger than the current index?
           return (nCurrentDisketteNo < disketteCount) ? true : false;
      }
      else {
           throw new Exception("Unable to get file pointer from StreamWriter");
      }
 }
private bool isdisketboundary(参考StreamWriter输出,int nCurrentDisketteNo){
//获取当前文件指针位置

//long filePosition=nOStream.tellp();我想您正在寻找

swOutput.BaseStream.Position

请参阅MSDN:。

然后升级您的客户!;-)@Kos按照他们支付给我公司的金额,我认为这可能是个坏主意。:p真名是“软盘”=)@Calvin1602澄清一下,是3.5“不是5.25”或8“磁盘。:p