Solved

Write to a floppy disk in C

Posted on 2004-04-15
2
272 Views
Last Modified: 2010-04-15
fp=fopen( "a:\test.txt","wt");

fprintf(fp,"%d",&num);

I have been using the above two lines of code in a
small program in an attempt to write to a text file
in my floppy (a:\) drive. However, nothing seems to
be happening. The program compiles with success
but does not write anything to the floppy disk.
Does any one know how to write to a floppy disk.

thanks in advance.

0
Comment
Question by:ions_j
2 Comments
 
LVL 45

Expert Comment

by:Kdo
ID: 10835230
Hi ions_j,

Check the returned value from fopen().

  fp = fopen ();
  if (fp == NULL)
  {
    perror ("Open failed");
    exit (0);
  }


Good Luck,
Kent
0
 
LVL 4

Accepted Solution

by:
booki earned 125 total points
ID: 10835280
ions_j,

Try changing:

>> "a:\test.txt"

To:

      "a:\\test.txt"

b.
0

Featured Post

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

An Outlet in Cocoa is a persistent reference to a GUI control; it connects a property (a variable) to a control.  For example, it is common to create an Outlet for the text field GUI control and change the text that appears in this field via that Ou…
Preface I don't like visual development tools that are supposed to write a program for me. Even if it is Xcode and I can use Interface Builder. Yes, it is a perfect tool and has helped me a lot, mainly, in the beginning, when my programs were small…
The goal of this video is to provide viewers with basic examples to understand opening and writing to files in the C programming language.
The goal of this video is to provide viewers with basic examples to understand and use conditional statements in the C programming language.

803 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question