![]() |
|
#1
|
|||
|
|||
coding wont read the filehi n tq dave ,...ive resolved the problem wif the header...
one question my program should read string from file and the file named example.txt in folder test in bcc55 directory in c. but why it doesnt read the file n im sure the coding was right.... hope u guys can help and the example.txt file only containe word hi... the result show unable to open file CPP / C++ / C Code:
in what way must i keep the output file? Last edited by LuciWiz : 03-Dec-2006 at 06:31.
Reason: Please insert your C/C++ code between [cpp] & [/cpp] tags
|
|
#2
|
||||
|
||||
Re: coding wont read the fileWorks for me. Are you sure the file exists where you are specifying?
Also, please use proper English. Many people here don't speak short-talk or whatever that is. And Guidelines #1 shows the proper use of code tags. __________________
Age is unimportant -- except in cheese |
|
#3
|
|||
|
|||
Re: coding wont read the fileQuote:
Well, it is not right (and the proof is that it doesn't work the way you expected). The file name inside the string literal can be done two ways: CPP / C++ / C Code:
Or CPP / C++ / C Code:
Inside a string, something like "\t" is a tab character. "\b" is a backspace, etc. If you want a backslash in a string literal, then it is "\\". However, as my second example shows, you can actually use forward slashes (Yes! Even in Windows XP! It's documented by Microsoft!). If you want to see what Windows thought your file name was, you could try: CPP / C++ / C Code:
Code:
Regards, Dave |
|
#4
|
||||
|
||||
Re: coding wont read the fileAhh, missed that since I edited the file name.
__________________
Age is unimportant -- except in cheese |
Recent GIDBlog
Halfway done! by crystalattice
| Thread Tools | Search this Thread |
| Rate This Thread | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Airport Log program using 3D linked List : problem reading from file | batrsau | C Programming Language | 11 | 29-Feb-2008 07:44 |
| php.ini file not being read | ian111 | Apache Web Server Forum | 1 | 29-Jun-2005 11:35 |
| How to detect end of file with read() function call? | nkhambal | C Programming Language | 6 | 12-Oct-2004 01:08 |
| CD burner wont burn!! | robertli55 | Computer Hardware Forum | 1 | 18-Jun-2004 10:53 |
| Yet another CD burner problem: Lite-On LSC-24082K | Erwin | Computer Hardware Forum | 1 | 22-May-2004 11:28 |
Network Sites: GIDNetwork · GIDWebHosts · GIDSearch · Learning Journal by J de Silva, The