Seekg काम नहीं कर रहा है, जब मैं अपने फ़ाइल में ईओएफ तक पहुंचता हूं।क्यों getg getline के साथ काम नहीं करता है?
ifstream myFile("/path/file");
for(int i; i < 10; i++){
myFile.seekg(0);//reset position in myFile
while(getline(myFile, line)){
doSomething
}
}
तो, अब मैं इनपुट धारा हर पाश खोलने हूँ:
for(int i; i < 10; i++){
ifstream myFile("/path/file");//reset position in myFile
while(getline(myFile, line)){
doSomething
}
}
लेकिन मैं नहीं बल्कि 0. स्थिति करने की कोशिश करेगी कि मैं कैसे प्राप्त कर सकते हैं?
[seekg() फ़ंक्शन की संभावित डुप्लिकेट विफल हो जाती है] (http://stackoverflow.com/questions/11264764/seekg-function-fails) – amo