I am on Geany C++ on a Linux. I am supposed to run it through the terminal to have everything show up in a text file. On Geany I am supposed to hit compile, build, and execute and I am supposed to get an input and output file. I am not sure how to run the g++ -std=c++11 on the terminal because when I do that it says fatal error
As what is pointed out in the comments, you need to add the flag -std=c++0x. You can set it in the "Build" -> "Set build commands", then modify the commands in following boxs:
I am not sure if this is right but It says in the About Geany tab, it is Geany 1.27. Once I figure out what version Geany is, by adding the Set build command tabs that should help it work?
You want to be able to run it on your own computer. If this is for an assignment, communicate with your instructor or teaching assistant about your problems.
If you still can't get it to work, write your own to_string():
Thank you! Is there any way not to cout the numbers. Also, my program is supposed to input data to a file and output a file. How would I find the file?
My line was just an example of to_string, what you had in your first post should now work. You can just delete the line I have in main, and add in your own stuff.
I'm not sure what you mean. You have to create the input file if you want to be able to read it. Make sure the file is in the same place that the program is run from.
It's always a good habit to check if a file was correctly opened: