Vektörün size()
numaralı telefonunu çağırırken bu derleyici hatasını alıyorum. Niye ya?hatası C2228: '.size' öğesinin solunda class/struct/union olmalıdır
#include <vector>
#include <iostream>
#include <fstream>
#include <sstream>
#include <string>
#include <cassert>
using namespace std;
class Vertex {
float firstValue;
float secondValue;
float thirdValue;
Vertex (float first, float second, float third){
firstValue=first;
secondValue=second;
thirdValue=third;
}
};
int main()
{
cout<<"This program loads a 3D .off object. \nEnter the name of the file that describes it "<<endl;
string inputFileName;
getline(cin, inputFileName);
ifstream inputFileStream;
inputFileStream.open(inputFileName.data());
assert (inputFileStream.is_open());
string actualLine;
for(;;){
inputFileStream>>actualLine;
istringstream actualLineStream(actualLine);
std::vector<float> results(std::istream_iterator<int>(actualLineStream)
, std::istream_iterator<int>());
int resultsIndex=0;
int resultsSize=results.size(); //WHY??
while (resultsIndex<resultsSize){
cout<<results[resultsIndex]<<endl;
}
if (inputFileStream.eof()) break;
}
ofstream outputChannel;
while (true){} // to keep on console view
return 0;
}
Vay .. ben hiç düşünmemiştim olurdu. – andandandand
Bu gönderiyi bulduğuma sevindim. Bu davranış korkunç. –
Evet, şükürler olsun bunu buldum. Dizüstü bilgisayarımı pencereden dışarı atmaya hazırdım. – MikeTheLiar