Solved

Write to a floppy disk in C

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

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Suggested Solutions

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…
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…
The goal of this video is to provide viewers with basic examples to understand opening and writing to files in the C programming language.
Video by: Grant
The goal of this video is to provide viewers with basic examples to understand and use for-loops in the C programming language.

758 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

21 Experts available now in Live!

Get 1:1 Help Now