Solved

Write to a floppy disk in C

Posted on 2004-04-15
2
263 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

Why spend so long doing email signature updates?

Do you spend loads of your time carrying out email signature updates? Not very interesting are they? Don’t let signature updates get you down. Let Exclaimer Cloud - Signatures for Office 365 make managing email signatures a breeze.

Question has a verified solution.

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

Have you thought about creating an iPhone application (app), but didn't even know where to get started? Here's how: ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ Important pre-programming comments: I’ve never tri…
This tutorial is posted by Aaron Wojnowski, administrator at SDKExpert.net.  To view more iPhone tutorials, visit www.sdkexpert.net. This is a very simple tutorial on finding the user's current location easily. In this tutorial, you will learn ho…
Video by: Grant
The goal of this video is to provide viewers with basic examples to understand and use while-loops in the C programming language.
The goal of this video is to provide viewers with basic examples to understand how to create, access, and change arrays in the C programming language.

911 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

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now