Thread: File processing

  1. #1
    Registered User Nutshell's Avatar
    Join Date
    Jan 2002
    Posts
    1,020

    File processing

    Hi,

    I wanna know is how to create a file in a specific directory. And if I don't specify a directory, what's the default directory that the file will be created in?

    For example, in the following code, where will the file be created?

    Code:
    cfPtr = fopen( "client.dat", "w" )
    Pls also tell me how to create a file in a specific directory.

    thnx in advance

  2. #2
    &TH of undefined behavior Fordy's Avatar
    Join Date
    Aug 2001
    Posts
    5,793
    Your file will be created in the same Dir as your app.

    To creat in a different dir;


    Code:
    cfPtr = fopen( "C:\\somedir\\client.dat", "w" )
    Dont forget the extra escape char

  3. #3
    Registered User Nutshell's Avatar
    Join Date
    Jan 2002
    Posts
    1,020
    oops, yea i really forgot about the escape character...thnx

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. File Writing Problem
    By polskash in forum C Programming
    Replies: 3
    Last Post: 02-13-2009, 10:47 AM
  2. sequential file program
    By needhelpbad in forum C Programming
    Replies: 80
    Last Post: 06-08-2008, 01:04 PM
  3. Encryption program
    By zeiffelz in forum C Programming
    Replies: 1
    Last Post: 06-15-2005, 03:39 AM
  4. file processing updating record error
    By uuser in forum C Programming
    Replies: 2
    Last Post: 04-27-2003, 12:13 AM
  5. System
    By drdroid in forum C++ Programming
    Replies: 3
    Last Post: 06-28-2002, 10:12 PM