473,396 Members | 1,879 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Linked Lists and File Writing

Hi all,
I'm just going to get right down my question since the exact program details are unnecessary and complicated.
Basically, I have a database handler that writes to a file certain data. Since I will have to be able to remove, add, and edit each piece of data, I decided to implement a singly linked list. Each node contains the elements of data that I need.
Now, this is where I get confused and was hoping someone could offer some advice on:
1) First of all, how in the world can I write a linked list to a file? Is this even possible? I'm not sure I fully understand what a "file" EXACTLY is.
2) If the above is possible, how can I access the file and thus the linked list inside of it?
3) Should I have a separate source code for my node and list implementations?

Much thanks in advance!
Feb 23 '08 #1
1 2491
gpraghuram
1,275 Expert 1GB
Hi all,
I'm just going to get right down my question since the exact program details are unnecessary and complicated.
Basically, I have a database handler that writes to a file certain data. Since I will have to be able to remove, add, and edit each piece of data, I decided to implement a singly linked list. Each node contains the elements of data that I need.
Now, this is where I get confused and was hoping someone could offer some advice on:
1) First of all, how in the world can I write a linked list to a file? Is this even possible? I'm not sure I fully understand what a "file" EXACTLY is.
2) If the above is possible, how can I access the file and thus the linked list inside of it?
3) Should I have a separate source code for my node and list implementations?

Much thanks in advance!

Are you trying to maintain the linked list inside a file or the data of a file inside a linked list?
If u want to access the data fast you can go for memory map but in that you cant delete data like a linked list

Raghuram
Feb 23 '08 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

7
by: Chris Ritchey | last post by:
Hmmm I might scare people away from this one just by the title, or draw people in with a chalange :) I'm writting this program in c++, however I'm using char* instead of the string class, I am...
1
by: Booser | last post by:
// Merge sort using circular linked list // By Jason Hall <booser108@yahoo.com> #include <stdio.h> #include <stdlib.h> #include <time.h> #include <math.h> //#define debug
4
by: MJ | last post by:
Hi I have written a prog for reversing a linked list I have used globle pointer Can any one tell me how I can modify this prog so that I dont have to use extra pointer Head1. When I reverse a LL...
17
by: Foodbank | last post by:
Hi, I have to write a program that will use linked lists to print the number of unique words, total words, and the most frequent word from a text file. I've gotten a decent amount of it done...
1
by: Little | last post by:
Could someone help me figure out how to put my project together. I can't get my mind wrapped around the creation of the 4 double Linked Lists. Thank your for your insight. 1. Create 4 double...
3
by: Little | last post by:
Could someone tell me what I am doing wrong here about declaring mutiple double linked lists. This is what the information is for the project and the code wil be below that. Thank your soo much for...
51
by: Joerg Schoen | last post by:
Hi folks! Everyone knows how to sort arrays (e. g. quicksort, heapsort etc.) For linked lists, mergesort is the typical choice. While I was looking for a optimized implementation of mergesort...
6
by: tgnelson85 | last post by:
Hello, C question here (running on Linux, though there should be no platform specific code). After reading through a few examples, and following one in a book, for linked lists i thought i would...
8
by: dmp | last post by:
What are Linked list? Please somebody show some ready made programs of linked list
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.