![]() |
|
#1
|
||||
|
||||
open files C++How do you open a file that is not in the lowest directory, and not in the highest directory.
for example, I use this code to get "temp.doc" from the lowest directory of the D drive. input.open("D:\\temp.doc"); Now I would like to get the file from "D:\me\temp.doc", but it does not work. I am not sure if I am just writing it in incorrectly or what but it does not work. I tried both "D:\me\temp.doc" and "D:\\me\temp.doc" Thanks for the help, Ronald __________________
This message is a natural product made from recycled electrons. The slight variations in spelling and grammar enhance its individual character and beauty and in no way are to be considered flaws or defects. |
||||
|
#2
|
|||
|
|||
|
Notice the path that works. It's got \\.
Remember what you use to type "special" characters, for instance \t prints a tab, \n prints a carriage return. \\ prints "\" - without the quote. When you tried to open "D:\\me\temp.doc", you were really trying to open "D:\me emp.doc" \t was interpreted as a tab. So to open your files, use 2 backslashes instead of one. Or a single forward slash should work too. GF |
|
#3
|
||||
|
||||
|
ahhhh, yes, I understand now. Thank you very much
__________________
This message is a natural product made from recycled electrons. The slight variations in spelling and grammar enhance its individual character and beauty and in no way are to be considered flaws or defects. |
|
#4
|
|||
|
|||
Re: open files C++hello
i new to vc++ my prob is on clicking on one button say x it shud navigate and show the contene of a file stored in local disk consider a folder which contains 10 files when i press that button x it shud show the content of first file in available 10 files there shud b another button also say NEXT on clicking on this it shud show the content of 2nd file and it goes on like dat upto 10 files there shud also another button say PREVIOUS dat shud navigate to previous files exactly opposite how NEXT button works Regards Ronny plz help me mail me code to my id niranjan.fl@gmail.com |
|
#5
|
||||
|
||||
Re: open files C++Welcome to GID.
You need to brush up on the Guidelines prominently displayed at the top of the forum, especially #2F and #7. You were doing well until Quote:
__________________
The 3 Laws of the Procrastination Society: 1) Never do today that which can be put off until tomorrow 2) Tomorrow never comes |
Recent GIDBlog
Problems with the Navy (Enlisted) by crystalattice
| Thread Tools | Search this Thread |
| Rate This Thread | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| gxx linker accepts only 7 object files | danielxs66 | C++ Forum | 1 | 12-Dec-2003 09:27 |
| VC++ 6.0, open command | calculus87 | C++ Forum | 0 | 25-Sep-2003 07:40 |
| files | calculus87 | C++ Forum | 3 | 23-Sep-2003 07:57 |
| inputing into files | calculus87 | C++ Forum | 1 | 23-Sep-2003 02:47 |
| any one knows about the address of the deleted files in FAT | shaam | C++ Forum | 1 | 09-Aug-2003 16:18 |
Network Sites: GIDNetwork · GIDWebHosts · GIDSearch · Learning Journal by J de Silva, The