• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 305
  • Last Modified:

Write to a floppy disk in C

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
ions_j
Asked:
ions_j
1 Solution
 
Kent OlsenData Warehouse Architect / DBACommented:
Hi ions_j,

Check the returned value from fopen().

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


Good Luck,
Kent
0
 
bookiCommented:
ions_j,

Try changing:

>> "a:\test.txt"

To:

      "a:\\test.txt"

b.
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now