How would I add an element to an array, assuming that I have enough space? My code looks something like this:
#include <iostream>
#include <fstream>
#include <string>
using namespace std;
int main(){
ofstream out("hi.out");
ifstream in("hi.in");
string currentLine;
string values[135];/*Enough for worst case scenario*/
if (out.is_open && in.isopen()){
while (in >> currentLine){
/*Add currentLine to values*/
}
/*Do stuff with values and write to hi.out*/
}
out.close()
in.close()
return 0;
}