Receives string from keyboard and write to a file

This is a discussion on Receives string from keyboard and write to a file within the C Programming forums, part of the General Programming Boards category; I wanted some help in c programming I am using visual studio 6 I just wanted to know how to ...

  1. #1
    Registered User
    Join Date
    Apr 2011
    Posts
    2

    Smile Receives string from keyboard and write to a file

    I wanted some help in c programming
    I am using visual studio 6
    I just wanted to know how to write a c program that receives string from a keyboard and then copy to a file (using FILES) that is already saved on my system D:


    Please help me because m jus learning c prog anddont know much

    appreciate ur help

    thanks

  2. #2
    and the hat of wrongness Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    32,558
    Use fgets() to read from stdin
    Use fputs() to write to a file - opened using fopen
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.
    I support http://www.ukip.org/ as the first necessary step to a free Europe.

  3. #3
    Banned
    Join Date
    Aug 2010
    Location
    Ontario Canada
    Posts
    9,547
    Take Salem's advice, then if you get stuck post your code here and we'll see what we can do.

    << !! Posting Code? Read this First !! >>

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. reading a string from keyboard
    By Mona777 in forum C++ Programming
    Replies: 11
    Last Post: 02-19-2009, 10:30 AM
  2. Replies: 14
    Last Post: 01-18-2008, 03:14 PM
  3. Read command line and write to file or string
    By miiisuuu in forum C Programming
    Replies: 1
    Last Post: 10-21-2007, 11:39 AM
  4. Ensuring That Main Child Window Receives Focus
    By SMurf in forum Windows Programming
    Replies: 3
    Last Post: 08-28-2006, 05:32 AM
  5. Client closes before server receives
    By LuckY in forum Networking/Device Communication
    Replies: 3
    Last Post: 07-06-2004, 04:08 PM

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