Im looking to reference a text file and make it into a variable but I cant figure out how... Would be a great help if someone could show me how. Im trying to use this.
/*
Only showing the additional code
*/
#include <fstream> //Add the file stream header
int main(){
char input_text[sizeoftext+1]; // sizeoftext is number of char's you want to read
char file_name[]="my_file.txt"; // the (ANSI) file you want to read from
ifstream file(file_name); // open the file for reading
file.getline(input_text, text_size); // put first text_size chars from the file in input_text
/*
your code here, using the input_text
*/
return 0;
}