Firstly do we have ftell() in c++. If yes then why is the code written below giving me this error " cannot convert `char*' to `FILE*' for argument `1' to `long int ftell(FILE*)' ". Pls tell me whats wrong and make corrections to my code.
Thanks,
prads
#include <iostream>
#include <fstream>
#include <cstring>
#include <cstdio>
#include <cstdlib>
#include <cmath>
using namespace std;
int main()
{
char rawsignal[38192],position;
int samplesread,blksize=100;
fstream file_op("c:\\t1.txt",ios::in);
while(!file_op.eof())
{
file_op.getline(rawsignal,blksize,'int8');
position=ftell(rawsignal); // not working!!!!!!!
cout<<"Position is"<<position<<endl;
samplesread=strlen(rawsignal)-2;
cout<<samplesread<<endl;
//cout <<rawsignal<<endl;
}
cout<<rawsignal<<endl;
if(samplesread!=blksize)
cout<<"Not able to read the specified number of samples for tracking, exiting!"<<endl;
file_op.close();
getchar();
return 0;
}
This post has been edited by jjhaag: 01 November 2007 - 05:34 PM

New Topic/Question
Reply




MultiQuote





|