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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T06:42:03+00:00 2026-05-28T06:42:03+00:00

Suppose I have a file insert.c in which two functions are defined: 1.insert_after 2.insert_before

  • 0

Suppose I have a file insert.c in which two functions are defined:
1.insert_after
2.insert_before

The definitions of these func are something like this:

insert_after(arg1)
{ 
  if(condition 1)
    { ......... } 
  else
    insert_before(arg1); 
}

insert_before(arg)
{ 
  if(condition 1)
    { ......... } 
  else
    insert_after(arg); 
}
    

Now if this file insert.c is included in main.c and insert_after function is called

# include "insert.c"
int main()
{
  insert_after(arg);
  return 0;
}

On compiling main.c using gcc,the following error is encountered:

conflicting types for ‘insert_before’

note: previous implicit declaration of ‘insert_before’ was here

What is wrong here and how to avoid 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-05-28T06:42:04+00:00Added an answer on May 28, 2026 at 6:42 am

    This is because you don’t declare prototypes for your functions. A function which has no prototype, by default, has an unknown set of arguments and returns an int. But this is not the case for insert_before.

    Create a file insert.h in which you declare them:

    #ifndef INSERT_H
    #define INSERT_H
    
    void insert_before(type_of_arg);
    void insert_after(type_of_arg);
    
    #endif /* INSERT_H */
    

    and include this file at the top of insert.c.

    You should then compile with:

    gcc -Wall -Wstrict-prototypes -Wmissing-prototypes -o progname insert.c main.c
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Suppose I have one file A which is a list with a two-digit key
Suppose I have a file X.h which defines a class X, whose methods are
Suppose I have a file fname which is a symlink to a file from
Suppose you have a file that contains IP addresses, one address in each line:
I'm interested in knowing how revision-control systems do merging. Suppose you have a file
Suppose you have a large file made up of a bunch of fixed size
Suppose I have a text file with data separated by whitespace into columns. I
Suppose I have an open file. How can I detect when the file is
Suppose I have a source file open and I launch a shell. I can
Suppose I have a source file that is 18218 bytes. I open the file

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.