Connecting Tech Pros Worldwide Help | Site Map

What is wrong with this call?

  #1  
Old November 18th, 2008, 04:15 AM
c.lang.myself@gmail.com
Guest
 
Posts: n/a
-----------------
fopen(”c:\try\clip1.dat”, “r”);
----------------
  #2  
Old November 18th, 2008, 04:25 AM
Peter Nilsson
Guest
 
Posts: n/a

re: What is wrong with this call?


"c.lang.mys...@gmail.com" <c.lang.mys...@gmail.comwrote:
Quote:
-----------------
fopen(”c:\try\clip1.dat”, “r”);
----------------
Three problems at least. First, you put your question in
the subject line alone. Second, you're using so called
smart quotes in C code. Fix those and you're ready to
be directed to the FAQ (q19.17) for the third issue.

--
Peter
  #3  
Old November 18th, 2008, 04:35 AM
Ben Bacarisse
Guest
 
Posts: n/a

re: What is wrong with this call?


"c.lang.myself@gmail.com" <c.lang.myself@gmail.comwrites:

It helps if you put the question in the body of the post: "What is
wrong with this call?"
Quote:
fopen(”c:\try\clip1.dat”, “r”);
I was surprised to see that this is not a FAQ (unless I missed it).
To put \ into a C string literal you need to write \\. The sequence
\t is a tab character and \c is undefined. You can also side-step the
problem since almost every C library accepts / as an alternative in
file names.

Also, you have the wrong quotes. You need "..." not the characters
you have. These may simply have been inserted by your posting
software so it may not be an issue in your code.

--
Ben.
  #4  
Old November 18th, 2008, 04:35 AM
Ben Bacarisse
Guest
 
Posts: n/a

re: What is wrong with this call?


Peter Nilsson <airia@acay.com.auwrites:

<snip>
Quote:
>... Fix those and you're ready to
be directed to the FAQ (q19.17) for the third issue.
Drat. I did miss it!

--
Ben.
  #5  
Old November 18th, 2008, 04:35 AM
Andrey Tarasevich
Guest
 
Posts: n/a

re: What is wrong with this call?


c.lang.myself@gmail.com wrote:
Quote:
-----------------
fopen(”c:\try\clip1.dat”, “r”);
----------------
Firstly, the quotes look funny.

Secondly, '\' character in C string literals (and character constants)
is a escape character. Use '\\' to represent the backslash character.

fopen("c:\\try\\clip1.dat", "r");

--
Best regards,
Andrey Tarasevich
  #6  
Old November 18th, 2008, 04:45 AM
Martin Ambuhl
Guest
 
Posts: n/a

re: What is wrong with this call?


c.lang.myself@gmail.com wrote:
Quote:
fopen(”c:\try\clip1.dat”, “r”);
\t is the escape sequence for a horizontal tab
\c is an undefined escape sequence

I doubt very much that your filename includes those characters.

There are two obvious suggestions to make:
1) If your question is worth asking, it is worth puting in the the body
of your message. Subject headers are not the place for anything
important for your message.
2) Buy any decent C text, and read the sections on character constants,
string literals, and escape sequences.
  #7  
Old November 18th, 2008, 05:05 AM
Sjouke Burry
Guest
 
Posts: n/a

re: What is wrong with this call?


c.lang.myself@gmail.com wrote:
Quote:
-----------------
fopen(”c:\try\clip1.dat”, “r”);
----------------
Rotten use of quote characters?
Closed Thread


Similar Threads
Thread Thread Starter Forum Replies Last Post
What is wrong with this code? Bill Reid answers 30 July 1st, 2007 02:05 AM
What is wrong with this. (files) noridotjabi@gmail.com answers 22 May 18th, 2006 04:35 PM
What is wrong with this code to populate a DropDownList? Rui Macdonald answers 2 November 19th, 2005 09:55 AM
what is wrong with this code ? hi-q Niklaus answers 6 November 14th, 2005 08:10 AM