Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8071625
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T13:44:51+00:00 2026-06-05T13:44:51+00:00

I am making a small program that reads a text file and stores it

  • 0

I am making a small program that reads a text file and stores it in the memory. It then lets the user add another line to the file, replace a line, add another word at a specific line etc…

At the end the user can save the content from the memory back to the file.
I did the same program in Python and used a multidimensional array, so each element in the array was an array of words.
This made it really easy to access a specific word at a specific line to be replaced with something else

Now I am trying to do the same thing with C and getting confused. After a little bit of messing around I am leaning more towards having a structure that has char words[]. This way I can delete a specific line by just dereferencing the NextNode from the previous to next.

I have two questions tho:
1. Is this a good way of accomplishing my goal?
2. How do I make a linked list with a FIXED size (e.g. no use of malloc). For example if I want to have a maximum 10 lines, how do I just make ten nodes and avoid malloc?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-05T13:44:53+00:00Added an answer on June 5, 2026 at 1:44 pm

    First of all, Why you want Fixed size?

    It is Easy to make a linked list with a FIXED size (e.g no use of malloc), It is called as an array of Structure 🙂

    If you can create a structure, say “node” :

    #define MAXLEN   100
    typedef struct node
    {
      int nLinenum;
      char Data[MAXLEN];
    
    };
    

    You can write:

    node static_linked_list[10];
    

    But you need to write a bit complex code to remove perticular node. It is not simple as compared to removing node from a linked list(with malloc).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm making a small tool application that user can minimize in the taskbar .
Making a small WCF test program which is based on a Store that has
How would I go about making a small program that keeps moving the mouse
I'm currently learning Windows/DOS assembly. I'm just making a small program that adds two
I am currently making a small test program for simple file checking. The program
I am making a small program using C++/CLI that use TcpListener , I know
I am making a small program in C# for Windows Phone. One thing that
I'm making a small launcher program for my Java program, the idea being that
I'm making a small program that uses a if else statement, but instead of
I'm making a small program that supposedly get all XML elements that can only

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.