Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
F

Farhan_Karim

@Farhan_Karim
About
Posts
4
Topics
2
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • Input multiple data types from a file into a linked list
    F Farhan_Karim

    yes i know that's why i am asking a solution for that.

    C / C++ / MFC database data-structures help announcement

  • Input multiple data types from a file into a linked list
    F Farhan_Karim

    i am working on a movie database and i have output from my file that i want to load into my linked list,no problem opening file but when i run this function it enters junk values in the list and only works if i enter all the strings without spaces or seperated by special characters. i am reading this from the txt file SHAWSHANK REDEMPTION 120 5 MYSTERY 2009 ENGLISH 3 THE MATRIX 120 5 MYSTERY 2009 ENGLISH 3 THE MATRIX PART1 120 5 MYSTERY 2009 ENGLISH 3 THE MATRIX PART2 120 5 MYSTERY 2009 ENGLISH 3 this is the code for load text from file into a linkedlist(doubly)

    void double_llist::loadfromfile(){

    string mname,mgenre,mlanguage;
    int mrelease\_year,mamount, mrating,mruntime;
        ifstream fromfile;
        fromfile.open("database.txt");
        while (fromfile >> mname >> mgenre >> mlanguage >> mrelease\_year>>mamount>>mrating>>mruntime)
    {
        /\* do something with name, var1 etc. \*/
        cout << mname<
    

    the code for doublylinkedlist

    void double_llist::create_list(string mname,
    string mgenre,
    string mlanguage,
    int mrelease_year,
    int mamount,
    int mrating,int mruntime)
    {

    struct node \*s, \*temp;
    temp = new(struct node);
    temp->info=id++;
    temp->name = mname;
    temp->genre=mgenre;
    temp->language=mlanguage;
    temp->release\_year=mrelease\_year;
    temp->amount=mamount;
    temp->rating=mrating;
    temp->runtime=mruntime;
    temp->next = NULL;
    if (start == NULL)
    {
        temp->prev = NULL;
        start = temp;
    }
    else
    {
        s = start;
        while (s->next != NULL)
            s = s->next;
        s->next = temp;
        temp->prev = s;
    }
    

    }

    my class and node struct for linkedlist

    #include
    #include
    #include
    #include
    #include
    /*
    * Node Declaration
    */
    using namespace std;
    struct node
    {
    int info;
    string name;
    string genre;
    string language;
    int release_year;
    int amount;
    int rating;
    int runtime;
    struct node *next;
    struct node *prev;
    static int counter;
    }*start;
    int id=1;
    /*
    Class Declaration
    */
    class double_llist
    {
    public:

        void create\_list(string mname,
    string mgenre,
    string mlanguage,
    int mrelease\_y
    
    C / C++ / MFC database data-structures help announcement

  • Getting forward from console applications to gui
    F Farhan_Karim

    Ok,Thanks :)

    C / C++ / MFC learning c++ help

  • Getting forward from console applications to gui
    F Farhan_Karim

    Hi,I recently completed the book Sams Teach yourself C++ and this website was mentioned there for help in further programming process I want some suggestions about getting started with programming in GUI,i am fed up of using console for 3 years learning c and c++ ;P

    C / C++ / MFC learning c++ help
  • Login

  • Don't have an account? Register

  • Login or register to search.
  • First post
    Last post
0
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups