Solved

Write to a floppy disk in C

Posted on 2004-04-15
2
291 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 45

Expert Comment

by:Kent Olsen
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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Summary: This tutorial covers some basics of pointer, pointer arithmetic and function pointer. What is a pointer: A pointer is a variable which holds an address. This address might be address of another variable/address of devices/address of fu…
Windows programmers of the C/C++ variety, how many of you realise that since Window 9x Microsoft has been lying to you about what constitutes Unicode (http://en.wikipedia.org/wiki/Unicode)? They will have you believe that Unicode requires you to use…
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.

739 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