naming a .txt file in c

This is a discussion on naming a .txt file in c within the C Programming forums, part of the General Programming Boards category; does anyone know how to name a .txt file through c with a name recieved from a char input....

  1. #1
    Registered User
    Join Date
    Dec 2002
    Posts
    3

    naming a .txt file in c

    does anyone know how to name a .txt file through c with a name recieved from a char input.

  2. #2
    Registered User
    Join Date
    Nov 2002
    Posts
    491
    man fopen

  3. #3
    ATH0 quzah's Avatar
    Join Date
    Oct 2001
    Posts
    14,826
    Originally posted by orbitz
    man fopen
    What? You don't rename with fopen. I suppose in a round about way you could: open, open, read, write, close, close, delete, but it's much simpler to execute a simple rename()

    Quzah.
    Hope is the first step on the road to disappointment.

  4. #4
    Registered User
    Join Date
    Dec 2002
    Posts
    32

    man pages

    what are they? everyone always talks about them.

  5. #5
    Registered User
    Join Date
    Nov 2002
    Posts
    491
    Originally posted by quzah
    What? You don't rename with fopen. I suppose in a round about way you could: open, open, read, write, close, close, delete, but it's much simpler to execute a simple rename()

    Quzah.
    Consider the fact that the questioner asked a rather ambigious question, fopen corresponds to how I interpreted the question.

    does anyone know how to name a .txt file through c with a name recieved from a char input.
    Does the questioner mean name or rename? If they want to know how to rename it then simpley add a 're' infront of name.

    I know fopen is not how you rename a file, I simply interpreted the question not to be how to rename a file, but how to open a file who's name has been given through some sort of user input.

  6. #6
    ATH0 quzah's Avatar
    Join Date
    Oct 2001
    Posts
    14,826
    Originally posted by orbitz
    Consider the fact that the questioner asked a rather ambigious question, fopen corresponds to how I interpreted the question.

    Does the questioner mean name or rename? If they want to know how to rename it then simpley add a 're' infront of name.
    Gotcha. I read it as "rename" rather than name. I'll blame it on being tired. That's a pretty good excuse...

    Quzah.
    Hope is the first step on the road to disappointment.

  7. #7
    Registered User
    Join Date
    Nov 2002
    Posts
    491
    Hah, thanks quzah.

  8. #8
    Registered User
    Join Date
    Dec 2002
    Posts
    32

    man pages

    Are there man pages on C? If so, where can i download 'em?

  9. #9
    ATH0 quzah's Avatar
    Join Date
    Oct 2001
    Posts
    14,826

    Re: man pages

    Originally posted by manwhoonlyeats
    Are there man pages on C? If so, where can i download 'em?
    Man pages are manual pages. They originated, and exclusivly reside, in *nix operating systems. (I might be slightly off on the origin, but the point is, there aren't man pages for Windows.)

    You can access them online in a number of places. As for "man pages on C", yes and no. There are man pages on most functions. Here is one of many sources where you can view them online. Go visit Google and you may be able to find them in downloadable form.

    Quzah.
    Hope is the first step on the road to disappointment.

  10. #10
    Evil Member
    Join Date
    Jan 2002
    Posts
    638
    Yes, there are man pages on C commands. The software for displaying them can be found here, although just about any decent operating system will have it included already.

  11. #11
    Registered User
    Join Date
    Dec 2002
    Posts
    3

    Unhappy

    what i mean is i want to create a user profile for the project i am working on and when a new user logs in they input their name and a text file (with the users name) of their profile is created.

  12. #12
    Registered User
    Join Date
    Dec 2002
    Posts
    32
    although just about any decent operating system will have it included already.
    that probably explains why i dont have them. i use windows.

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, 09:47 AM
  2. Formatting the contents of a text file
    By dagorsul in forum C++ Programming
    Replies: 2
    Last Post: 04-29-2008, 12:36 PM
  3. Encryption program
    By zeiffelz in forum C Programming
    Replies: 1
    Last Post: 06-15-2005, 03:39 AM
  4. Unknown Memory Leak in Init() Function
    By CodeHacker in forum Windows Programming
    Replies: 3
    Last Post: 07-09-2004, 09:54 AM
  5. Need a suggestion on a school project..
    By Screwz Luse in forum C Programming
    Replies: 5
    Last Post: 11-27-2001, 01:58 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21