DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 2 of 2

Thread: ** NEED ASAP**** How do I input file in a linked list program??

Hybrid View

  1. #1
    cc Guest

    ** NEED ASAP**** How do I input file in a linked list program??


    Help.
    I have a program I did that has a linked list with a queue but I am not sure
    how do I get the program to read an input file instead of typing in my code
    what data I need it to read.

    Help.

    Pleasee....

  2. #2
    jonnin Guest

    Re: ** NEED ASAP**** How do I input file in a linked list program??


    #include<fstream>

    ifstream f;
    f.open("name", flags); //see your book

    temp = head; //or whatever your list looks like.
    while(!f.eof()) //while not end of file
    f >> temp->data; //read and save it in the list...





    "cc" <caraccia@bestweb.net> wrote:
    >
    >Help.
    >I have a program I did that has a linked list with a queue but I am not

    sure
    >how do I get the program to read an input file instead of typing in my code
    >what data I need it to read.
    >
    >Help.
    >
    >Pleasee....



Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center