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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T17:06:57+00:00 2026-06-13T17:06:57+00:00

struct subscriber { char phonenumber[20]; char name[50]; float amount; }s; void modifyrecords() FILE *f;

  • 0
struct subscriber

{

  char phonenumber[20];

  char name[50];

  float amount;

}s;

void modifyrecords()

  FILE *f;

  char phonenumber[20];

  long int size=sizeof(s);

  if((f=fopen("c:/file.ojs","rb+"))==NULL)

    exit(0);

  system("cls");

  printf("Enter phone number of the subscriber to modify:");

  scanf("%[^\n]",phonenumber);

  fflush(stdin);

  while(fread(&s,sizeof(s),1,f)==1)

  {

    if(strcmp(s.phonenumber,phonenumber)==0)

    {

      system("cls");

      printf("\n Enter phone number:");

      scanf("%s",&s.phonenumber);

      printf("\n Enter name: ");

      fflush(stdin);

      scanf("%[^\n]",&s.name);

      printf("\n Enter amount: ");

      scanf("%f",&s.amount);

      fseek(f,-size,SEEK_CUR);

      fwrite(&s,sizeof(s),1,f);

      break;

    }

  }

  fclose(f);

}

C:\Users***\Desktop\a.c|394|error: parameter ‘size’ is initialized|
I am getting parameter ‘size’ is initialized error in this code. After googling I found out I may have to pass certain arguments to suppress these kind of errors. Is this the only solution? Actually I am using Code::Blocks so if is the only way how do I pass command line arguments in it?

  • 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-13T17:06:58+00:00Added an answer on June 13, 2026 at 5:06 pm

    You have a simple syntax error here:

    void modifyrecords()
    

    should be:

    void modifyrecords() {
    

    Also, this:

    scanf("%s",&s.phonenumber);
    

    should be

    scanf("%s",s.phonenumber);
    

    And that applies to s.name as well.

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

Sidebar

Related Questions

Code: #include <stdio.h> #include <stdlib.h> #include <unistd.h> struct subscriber { char phonenumber[20]; char name[50];
struct test{ unsigned long int asd[][3][6]; }; sizeof(struct test) returns 0. So, if that
struct { char a; int b; } x; Why would one define a struct
struct Drink { public string Name { get; private set; } public int Popularity
struct A { int a; virtual void print() {} }; struct B : A
struct match { char men[64]; char women[64]; char menNum[1000]; char woNum[1000]; }; void printOut();
struct DummyStruct{ unsigned long long std; int type; }; DummyStruct d; d.std = 100;
struct X{}; template<class T> decltype(X() == int()) f(T const&){ return true; } int main(void)
struct Vector { float i,j,k; } std::vector pt[size]; ... = ... + pt[temp]; temp
struct Test { int a; char b; int c; } __attribute__((packed, aligned( 128 )))test;

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.