GIDForums  

Go Back   GIDForums > Computer Programming Forums > C++ Forum
User Name
Password
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

 
 
Thread Tools Search this Thread Rate Thread
  #1  
Old 25-Sep-2003, 11:35
calculus87's Avatar
calculus87 calculus87 is offline
Junior Member
 
Join Date: Sep 2003
Location: FLorida
Posts: 41
calculus87 is on a distinguished road

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  
Old 25-Sep-2003, 11:51
Garth Farley Garth Farley is offline
Invalid Email Address
 
Join Date: May 2002
Location: Ireland
Posts: 638
Garth Farley is a jewel in the roughGarth Farley is a jewel in the roughGarth Farley is a jewel in the rough
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  
Old 25-Sep-2003, 12:52
calculus87's Avatar
calculus87 calculus87 is offline
Junior Member
 
Join Date: Sep 2003
Location: FLorida
Posts: 41
calculus87 is on a distinguished road
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  
Old 09-Aug-2006, 09:24
ronny ronny is offline
New Member
 
Join Date: Aug 2006
Posts: 1
ronny is on a distinguished road

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  
Old 09-Aug-2006, 11:42
WaltP's Avatar
WaltP WaltP is offline
Outstanding Member
 
Join Date: Feb 2004
Location: Midwest US
Posts: 3,245
WaltP is a name known to allWaltP is a name known to allWaltP is a name known to allWaltP is a name known to allWaltP is a name known to allWaltP is a name known to all

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:
Originally Posted by ronny
plz help me mail me code to my id niranjan.fl@gmail.com
which looks to us like a "do this for me" request. I know you didn't mean it this way, but that's the way it looks.
__________________

Age is unimportant -- except in cheese
 
 

Recent GIDBlogDeveloping GUIs with wxPython (Part 2) by crystalattice

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

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

All times are GMT -6. The time now is 17:11.


vBulletin, Copyright © 2000 - 2008, Jelsoft Enterprises Ltd.