void ReadIntoArray(void){
varuread.open("varulager.txt");
if(!varuread){
cout<<"Filen kunde inte öppnas";
exit(1);
}
AntalVaror=0;
Type: Posts; User: Charlin
void ReadIntoArray(void){
varuread.open("varulager.txt");
if(!varuread){
cout<<"Filen kunde inte öppnas";
exit(1);
}
AntalVaror=0;
The Array contains String, Float and int. And Im kind of a newbie at c++ so I don't exactly know what your talking about..
I have an array that I need to update after using a function. So I need to know how to empty it before I call on the function that reads everything into the array. Simple enough to solve?
Since Im using the textfile in other functions I thought that was the best with a global declaration..
That's because Im writting a quite big program and this is just a function. I have it declared in the top of my program.
EDIT; Got the error message, error C2676: binary '<<' : 'class...
varulager << artnr, artname, artpris; ?
I want to get artnr, artname and artpris to a textfile called varulager.txt . But I don't really remember how, can getline() send all the variables as I have written to the textfile?
void...