I'm new to I/O streams and working with files when it comes to C++ and I'm trying to write a program that will take data inside a file and output it in an organized way. I'm working on a Mac and my file is saved on the desktop under "Shopping.txt". Whenever I build the project I don't get any errors but when I run it I get the error "No such file or Directory". I'm using CodeLite and I'm not sure if there is something I need to change with my settings. Here is my code if it is any help. Thanks!
"No such file or Directory" well you will need to provide the path to the file in your program so that it will know where to get the file, alternatively you can save the txt file inside your program
folder and it will find it when searching without providing the path.
Here shoppingList.open("Shopping.txt"); for examples I use Windows i would do something like ShoppingList.open ("c:\users\andy\desktop\mytxtfiles\Shopping.txt"); something like that
Edit it would be a bad idea to place your program txt on a different directory other tjan you program directory someone might open your file and change its components , advice save it in your program files