Thread: help with strings...please!!!

  1. #1
    Unregistered
    Guest

    Exclamation help with strings...please!!!

    I am a novice C programmer and I am having trouble understanding how to read a line in from a file and capture only part of the line into a variable. Could someone out there please show me how this can be done.
    Thanks so much!
    -Linda

  2. #2
    End Of Line Hammer's Avatar
    Join Date
    Apr 2002
    Posts
    6,231
    There are various ways, depending on your data, and how you want to handle it. I'd suggest you research:

    fopen()
    fgets()
    fgetc()
    fread()
    fclose()

    and if your desperate:
    fscanf().

    Once you have data in memory, you can slice and dice with various string utilities.
    When all else fails, read the instructions.
    If you're posting code, use code tags: [code] /* insert code here */ [/code]

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Strings Program
    By limergal in forum C++ Programming
    Replies: 4
    Last Post: 12-02-2006, 03:24 PM
  2. Programming using strings
    By jlu0418 in forum C++ Programming
    Replies: 5
    Last Post: 11-26-2006, 08:07 PM
  3. Reading strings input by the user...
    By Cmuppet in forum C Programming
    Replies: 13
    Last Post: 07-21-2004, 06:37 AM
  4. damn strings
    By jmzl666 in forum C Programming
    Replies: 10
    Last Post: 06-24-2002, 02:09 AM
  5. menus and strings
    By garycastillo in forum C Programming
    Replies: 3
    Last Post: 04-29-2002, 11:23 AM