Re: tellg(); alternative Programming Software Development by vijayan121 > tellg() in my code as the function is not supported on the desired hardware. What hardware? A `std::istringstream` holds a `std::stringbuf` and it does not use anything other than memory allocated with the standard allocator. Have you tried printing out the result returned by `tellg()` on the string stream? tellg(); alternative Programming Software Development by Alexkid … I need to re-write any mention of .tellg() in my code as the function is not …gt; forth; UINT32 file_pos = stream.tellg(); file_pos++; fifth = line.substr( file_pos , line.length() - stream.tellg() ); } As far as I…of finding the position in the stream without using tellg();? Would I have to get rid of istringstream… Re: tellg(); alternative Programming Software Development by deceptikon … any clauses in the ISO standard that say tellg() may be conditionally supported in the presence of…, you can get the same value as stream.tellg() by counting delimiting whitespace for the first four fields… break; } } fifth = line.substr(++file_pos , line.length() - stream.tellg()); } Re: tellg(); alternative Programming Software Development by vijayan121 > I think its something to do with a certain version of the GNU GCC complier and using MINGW. Works fine in Windows but not in VxWorks: > http://gcc.gnu.org/bugzilla/show_bug.cgi?id=13333 "fstream tell/seek bug with DOS-format text files" seekg() and tellg() on fstream (not stringstream). HELP!!!: Seekp() & Tellg() Problem in C++ Programming Software Development by abhi1 …(current_user, ios::in); fopen>>sw.balance; bal_l=fopen.tellg(); bal_s=ceil(log10(sw.balance)); fopen>>sw.age…; age_l=fopen.tellg(); age_s=ceil(log10(sw.age)); //find numbr of digits fopen… C++ and have to use the same algo, means seekp-tellg thingy.... Please helpppppp Problem in tellg(). Programming Software Development by moein_soltani Hi Guys.. I have a problem in tellg() function.. When I open file in Binary mode , It returns …[t].right=list[t].left=0; input.get(); } position=input.tellg();[/CODE] it is so interesting that when I add cout…<<input.tellg() in the scope it returns very bad value and many… File Position tellg() Programming Software Development by himgar …;,ios::app|ios::in|ios::binary); cout<<f.tellg(); f.close(); } [/code] My file test.txt already contains text… Logfile seeking problem Programming Software Development by iamthesgt …time_to_end(datetest,dateend)) { logfile.seekg(current); end = logfile.tellg(); //When to end ctrl = 2; } else {}…{ end = logfile.tellg(); break; } current = logfile.tellg(); } logfile.seekg(begin); current = logfile.tellg();//Here it can be… Re: problem with seekg Programming Software Development by vijayan121 … \n lines\n\n" ; fstream::pos_type namepos = file.tellg() ; file << "name string" <…; '\n' << '\n' ; fstream::pos_type phonepos = file.tellg() ; file << 12345678 << '\n'<< …'\n' << '\n' ; fstream::pos_type addresspos = file.tellg() ; file << "address string\n" ; file … Re: problem with seekg Programming Software Development by vijayan121 … here's their example ... AARGH! 1. stream::tellg() returns an streampos, which isn't guaranteed to be…, std::ios::beg ) ; const std::streampos beginpos = file.tellg() ; file.seekg( 0, std::ios::end ) ; const std…::streampos endpos = file.tellg() ; const std::streamoff nchars = endpos - beginpos ; std::cout… Re: problem with seekg Programming Software Development by jesseb07 … myfile ("example.txt"); begin = myfile.tellg(); myfile.seekg (0, ios::end); end = myfile.tellg(); myfile.close(); cout << "… problem with seekg Programming Software Development by jesseb07 … to why. I should mention that when I do file.tellg() right before the second part, it says -1 whether I… Re: problem with seekg Programming Software Development by krnekhelesh Yeah I agree with vijayan. File pointers like seekg(),tellg() work correctly only with Binary Files where the read() and write() functions are used. Re: problem with seekg Programming Software Development by vijayan121 … for the seek wasn't one returned by an earlier tellg on the same stream/filebuff, all bets are off. c… Re: problem with seekg Programming Software Development by Ancient Dragon … for the seek wasn't one returned by an earlier tellg on the same stream/filebuff, all bets are off. c… Address Book Application... (here's what I have done so far..) Programming Software Development by forgotten …lt;<"tellg: "<<file.tellg()<<endl;//debug if(file.tellg()==0) return(0…<<"Result tellg: "<<(1+file.tellg()/MaxRecSize)<<endl;//debug… return(1+file.tellg()/MaxRecSize); }//th4 debug } ////////////////////////////////////////////////////////////////////////////// Entry Abook::… Please Help - Reading a file in efficient manner Programming Software Development by anjaliraman …lt; g_bClientActive); try { nPosMsg_1 = nPosMsg_2 = m_streamSyslog.tellg(); while( g_bClientActive && !g_bExit ) { if…SYSLOG_MAX_MSG_LEN); validateTrap(cBuffer, pListSNMPTrapInfo, nSemID); nPosMsg_1 = nPosMsg_2 = m_streamSyslog.tellg(); nWaitCount = 0; } else if(nPosMsg_1 != nPosMsg_2) { nWaitCount… Insert a file inside a file function Programming Software Development by sasho648 …::ios::end); const unsigned long endin = inFile.tellg(); const unsigned long endma = maFile.tellg(); unsigned long NumTree(0); for(unsigned long Curr…(0, std::ios::end); const unsigned long endcac = (int)cacFile.tellg()-1; for(unsigned long Curr(0); Curr<endcac; ++Curr… fstream Tutorial Programming Software Development by FireNet ….seekg(); //move the read pointer in bytes 2.tellg(); //returns where the read pointer is in bytes … pointer location in bytes. Eg. int rp = file.tellg(); int wp = file.tellp(); The seek pointers take…//move to the end of the file int fl_sz = file.tellg(); //tell me where you are, partner( pointer ) ! int… C++: ifstream file pointer not getting reset Programming Software Development by samarth …, "1.mpg"); cout << "tellg " << file.tellg()<< endl; char buf[1024]; ReadFile(buf…(); OpenFile(file, "1.mpg"); cout << "tellg " << file.tellg()<< endl; return 1; }[/code] {Urgent} need help with file compression and decompression Programming Software Development by j2swift … file fp_in.seekg(0,ifstream::end); size=fp_in.tellg(); fp_in.seekg(0); size=1000; // allocate …the file fp_in2.seekg(0,ifstream::end); size1=fp_in2.tellg(); fp_in2.seekg(0); // allocate memory for file …the file fp_in2.seekg(0,ifstream::end); size1=fp_in2.tellg(); fp_in2.seekg(0); // allocate memory for file … Re: Are get and put pointers really independent? Programming Software Development by vijayan121 …lt; '\n' ; cout << "tellg: " << in_file.tellg() << '\n' ; out_file.seekp( -…; '\n' ; cout << "tellg: " << in_file.tellg() << '\n' ; in_file.seekg( …lt; '\n' ; cout << "tellg: " << in_file.tellg() << '\n' ; cout <<… Database saving problem and windows forms Programming Software Development by originaldaemon … hfile.seekg(0, ios::end); fileSize = hfile.tellg(); hfile.seekg(0, ios::beg); index = 0;…lt;endl; index++; }while(fileSize != hfile.tellg()); }else{ cout<<"The database … = index; break; } } } } index++; }while(fileSize != hfile.tellg()); }else{ cout<<"the database is empty ... "… Problem passing a filename to a function Programming Software Development by StaticX … HERE?) { // This variable will store the return of tellg(),or size of the file in bytes. int sizeOfFile = …file by using seekg for the file pointer // and tellg to return the size in bytes. // move file …the eof. file->seekg(0,fstream::end); //use tellg() to get the size of the file. sizeOfFile = file… Binary file problem Programming Software Development by OffbeatPatriot … of it gibberish), which seems to suggest that tellg() is changing something instead of join reading the… ifstream file("monkey.c3d"); cout << file.tellg() << endl; int count; float x, y, … reverseBytes((char*)&count, 4); cout << file.tellg() << endl; cout << count <&… ofstream nonsense Programming Software Development by n0de … other programs everything is fine with seekg, or tellg, and everything else which here is a problem… error: ‘struct std::ofstream’ has no member named ‘tellg’ [/CODE] Function in which are these problems: [CODE]…tm_sec; issaugomas[i].sDBID = sPB.c_str + osB.tellg() + data; //tellg pasako vietą, nuo kur reikia skaityti duomenis osB <… Date Validation Programming Software Development by neewb …//Figure out How many records exist long a = file.tellg(); file.seekg(0, fstream::end); long b = file….tellg(); long sizeFile = b - a; int c = sizeof(rec); int …//Figure out How many records exist long a = file.tellg(); file.seekg(0, fstream::end); long b = file… Re: ofstream nonsense Programming Software Development by n0de …(0, ios::end); // keliauje į bylos pabaigą dbbB[i].stBD = isF.tellg(); // sužinome bylos dydį isF.seekg(0, ios::beg); // gr… + t->tm_sec; issaugomas[i].sDBID = sPB.c_str + osB.tellg() + data; //tellg pasako vietą, nuo kur reikia skaityti duomenis osB <<… amigious problem with fstream Programming Software Development by Hisham4FCI ….seekg(0,ios::beg); cout<<File.tellg()<<endl; //tellg()=-1??? File.read((char*)&st,sizeof(Student)); while… the file only one time :( and it print that File.tellg()=-1 why is it ?although i wrote File.seekg(0… Re: Database saving problem and windows forms Programming Software Development by originaldaemon …::in|ios::out); hfile.seekg(0, ios::end); fileSize = hfile.tellg(); hfile.seekg(0, ios::beg); index = 0; if (fileSize >…;<temp.genre<<endl; index++; }while(fileSize != hfile.tellg()); }else{ cout<<"The database is empty... press…