473,320 Members | 1,766 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

What is wrong with this call?

-----------------
fopen(”c:\try\clip1.dat”, “r”);
----------------
Nov 18 '08 #1
6 1191
"c.lang.mys...@gmail.com" <c.lang.mys...@gmail.comwrote:
-----------------
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
Nov 18 '08 #2
"c.***********@gmail.com" <c.***********@gmail.comwrites:

It helps if you put the question in the body of the post: "What is
wrong with this call?"
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.
Nov 18 '08 #3
Peter Nilsson <ai***@acay.com.auwrites:

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

--
Ben.
Nov 18 '08 #4
c.***********@gmail.com wrote:
-----------------
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
Nov 18 '08 #5
c.***********@gmail.com wrote:
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.
Nov 18 '08 #6
c.***********@gmail.com wrote:
-----------------
fopen(”c:\try\clip1.dat”, “r”);
----------------
Rotten use of quote characters?
Nov 18 '08 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

10
by: Greener | last post by:
Hi, I need help badly. Can you do client-side programming instead of server-side to capture the Browser type info? If this is the case, what's wrong with the following? <script...
51
by: WindAndWaves | last post by:
Can anyone tell me what is wrong with the goto command. I noticed it is one of those NEVER USE. I can understand that it may lead to confusing code, but I often use it like this: is this...
17
by: candy_init | last post by:
I sometimes comes across statements which invloves the use of size_t.But I dont know exactly that what is the meaning of size_t.What I know about it is that it is used to hide the platform...
15
by: XZ | last post by:
Hi everyone, this is really confusing to me: #include <stdio.h> main(int argc, char **argv) { printf("argv = %f\n",(double)atof(argv)); printf("argv = %d\n\n",atoi(argv)); } $ a.out a argv...
13
by: Jason Huang | last post by:
Hi, Would someone explain the following coding more detail for me? What's the ( ) for? CurrentText = (TextBox)e.Item.Cells.Controls; Thanks. Jason
4
by: Rachel Suddeth | last post by:
What is the difference between a managed/unmanaged resource, and how do you tell which is which? I'm trying to understand how to write some Dispose() methods, and we are supposed to put code that...
669
by: Xah Lee | last post by:
in March, i posted a essay “What is Expressiveness in a Computer Language”, archived at: http://xahlee.org/perl-python/what_is_expresiveness.html I was informed then that there is a academic...
14
by: Mohamed Mansour | last post by:
Hey there, this will be somewhat a long post, but any response is appreciated! I have done many PInvoke in the past from C++ to C#, but I did PInvoke within C# not C++/CLI. Can someone explain...
4
by: hirsh.dan | last post by:
i have a functions that writes information to a file. inside that function i have a line in which i call another function. if this line is executed, nothing is written to the file, but if i remark...
16
by: John Doe | last post by:
Hi, I wrote a small class to enumerate available networks on a smartphone : class CNetwork { public: CNetwork() {}; CNetwork(CString& netName, GUID netguid): _netname(netName),...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shćllîpôpď 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.