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 3273668
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T18:57:22+00:00 2026-05-17T18:57:22+00:00

first post here so be nice ;) Is it possible to store a FILE

  • 0

first post here so be nice 😉

Is it possible to store a FILE * in a struct, i see no reason why not but the following code wont compile, i can’t seem to store a reference to file pointer either.

typedef struct fileType
{
    FILE * file;
    char fileName[MAX_FILENAME_LEN];
    unsigned linesRead;
    unsigned nextBufLine;           /* next line to be inserted/removed in the buffer */
    pthread_mutex_t * mtxFile;      /* mutex controlling access to this file */
}FileType;

My compiler doesn’t seem to recognise the type ‘FILE’ throwing this error at that line, and of course i have included stdio.h in the header

error: expected specifier-qualifier-list before '(' token

Basically I’m writing a program which spawns a a series of child process, taking turns to read lines from a file and inserting them into a circular buffer where they are read by a another set of child processes, encrypted and written to a new file (line by line). It is a requirement that the parent open and closes the file.

I’m permitted to use globals for this but want to avoid it if possible, thanks for any replies. =]

  • 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-05-17T18:57:23+00:00Added an answer on May 17, 2026 at 6:57 pm

    Do you have a macro somewhere which is redefining FILE or file as something else?

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

Sidebar

Related Questions

First post here, I have tried searching but couldn't find what I'm looking for
This is my first post here and I wanted to get some input from
Well, this is my first post here and really enjoying the site. I have
First post, so here goes. I'm writing a script that does intelligent search and
this is my first post on this website, but I'm all the time getting
first post here so sorry for the length of it. I've been lurking and
first post here on stack overflow, hoping to get some advice on how to
My first post here, please be gentle. =) I work for a company that
My first post here - it's a great site and I will certainly do
My first post here - it's a great site and I will certainly do

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.