Thread: print the data in a line

  1. #1
    Registered User
    Join Date
    Dec 2006
    Posts
    136

    print the data in a line

    any help
    Last edited by munna_dude; 06-16-2010 at 10:56 AM.

  2. #2
    Internet Superhero
    Join Date
    Sep 2006
    Location
    Denmark
    Posts
    964
    Read the file line by line, combine all the lines into a single char[] using the string functions, iterate the contents and remove all \n's and then add one manually at the back.
    How I need a drink, alcoholic in nature, after the heavy lectures involving quantum mechanics.

  3. #3
    Registered User
    Join Date
    Jun 2010
    Posts
    45
    im beginning to wonder if this is a joke. you've made 2 topics about this already and imo people have been quite generous with the help.

    just go here Cprogramming.com - Tutorials - C File I/O

    everything you need is on that page. its just a matter of reading it.

  4. #4
    Registered User
    Join Date
    Dec 2006
    Posts
    136
    Quote Originally Posted by Neo1 View Post
    Read the file line by line, combine all the lines into a single char[] using the string functions, iterate the contents and remove all \n's and then add one manually at the back.
    can you please provide me the example( special request).
    the total day was wasted by this string.

    any help it should be appreciable

  5. #5
    Internet Superhero
    Join Date
    Sep 2006
    Location
    Denmark
    Posts
    964
    Quote Originally Posted by munna_dude View Post
    can you please provide me the example( special request).
    the total day was wasted by this string.

    any help it should be appreciable
    It's against forum policy to do homework i believe, we can help but we won't write the code for you, that is your job. You should check out the link LordPC gave you, it's all in there.
    If you don't quite understand the code in that link, go back to the first tutorial and work your way back up until you get it.
    How I need a drink, alcoholic in nature, after the heavy lectures involving quantum mechanics.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. can't compile library
    By pjs111 in forum C Programming
    Replies: 16
    Last Post: 05-24-2010, 01:42 PM
  2. Line of data input method
    By larry_2k4 in forum C Programming
    Replies: 2
    Last Post: 04-28-2009, 11:34 PM
  3. Program Crashing
    By Pressure in forum C Programming
    Replies: 3
    Last Post: 04-18-2005, 10:28 PM
  4. gcc problem
    By bjdea1 in forum Linux Programming
    Replies: 13
    Last Post: 04-29-2002, 06:51 PM
  5. How to print out the data throw printer.Attn Salem
    By Jason in forum C Programming
    Replies: 2
    Last Post: 09-23-2001, 05:58 AM