It looks easy, but I can't get it to work. I'm using visual studio 2008 express edition, on windows 7. I have tried putting the file.txt in every directory of the project and the program always prints out "Error opening file". I also tried making an executable, and put the file.txt in the same directory as the executable, but it still did not work. Any thoughts?
When the project gets built and executed, there is usually some "working directory" that can be configured and changed. It's that working directory where the file would be expected to be. I found this link on changing the working directory: stackoverflow.com/questions/3079128/changing-the-debugging-working-directory-globally-not-per-user-in-vs2008. I would think by default, it would be something like bin/Default or bin/Release or something similar to that. Hopefully this helps! :-)
@@PortfolioCourses Thanks for your reply. At stack exchange I found some code that will 'cout' the current directory, including the program file's name. My file.txt is in that directory. However, the path includes "Visual Studio 2008", which has spaces in it. I will now move the program executable to a folder whose path has no spaces in it, and see if that makes a difference. Thanks again.
sir i wanted to ask that how can i read the line that user wants and the line to end example in void(string file_name,int startline,int endline,int color); like this startline from which line endline till that line
You are clearly an excellent teacher. Concise, orderly, clear, easy to understand expressions with a good affect. Thank You.
You're welcome, I'm glad to hear you enjoyed the teaching style! :-)
No tutorial made me undertand this so easy. Thank you so much.
You're very welcome Preo, I'm glad you enjoyed it! :-)
useful video thx man waiting for more of this content
Thank you! We have a playlist of C++ tutorials here that you might enjoy: th-cam.com/play/PLA1FTfKBAEX6BdpNaWp2uw-YspHwY7qwW.html
Aw man that's awesome i will check them all thanks 👍
@@zoxemo3838 You're welcome! :-D
Thanks for the excellent work!!!
You're welcome! :-D
It looks easy, but I can't get it to work. I'm using visual studio 2008 express edition, on windows 7. I have tried putting the file.txt in every directory of the project and the program always prints out "Error opening file". I also tried making an executable, and put the file.txt in the same directory as the executable, but it still did not work. Any thoughts?
When the project gets built and executed, there is usually some "working directory" that can be configured and changed. It's that working directory where the file would be expected to be. I found this link on changing the working directory: stackoverflow.com/questions/3079128/changing-the-debugging-working-directory-globally-not-per-user-in-vs2008. I would think by default, it would be something like bin/Default or bin/Release or something similar to that. Hopefully this helps! :-)
@@PortfolioCourses Thanks for your reply. At stack exchange I found some code that will 'cout' the current directory, including the program file's name. My file.txt is in that directory. However, the path includes "Visual Studio 2008", which has spaces in it. I will now move the program executable to a folder whose path has no spaces in it, and see if that makes a difference. Thanks again.
c# and visual studio make this so easy. Losing my mind trying to make this shit work in c++ ahaha
sir i wanted to ask that how can i read the line that user wants and the line to end example in void(string file_name,int startline,int endline,int color); like this startline from which line endline till that line
OK, that's a good idea for a video, I will add it to the list. What is "color" supposed to do?
where do i program this, it's not woking in onlinegdb
I was able to get it to work on onlinegdb by creating a new file called file.txt. Here is a link to the code and file: onlinegdb.com/dscXwl9cR. 🙂