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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T02:15:31+00:00 2026-06-09T02:15:31+00:00

i tried to write a program in C: Here is a piece of code:

  • 0

i tried to write a program in C:

Here is a piece of code:

#include <stdio.h>
int i, left, right, largest = 0, n = 9;
int a[] = {23, 12, 22, 1, 4, 5, 16, 8, 9, 10};
int main()
{
 sort(a);
 //code to print sorted numbers here
 return 0;

}

void sort(int a[])
{
 buildheap(a);
 for(i = n; i < 0; i--)
 {
  exchange(i, 0);
  n = n - 1;
  maxheap(a, 0);
 }
}

It shows warnings like this:

heapsort.c:16: warning: conflicting types for âsortâ

Is this because i’m nto including conio.h ?

When i tried to include conio.h, the gcc compiler throws error that conio.h is not found.

Any link or explanation in detail about the above warning and its relevance/irrelevance to conio.h will be helpful

Update

Im sorry for missing basics here.

Thank you so much. My program is running fine now

  • 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-09T02:15:34+00:00Added an answer on June 9, 2026 at 2:15 am

    It is because there is no declaration of sort() prior to its use. If a function is not declared (or defined) before it is used an implicit declaration is generated (the compiler should have emitted implicit declaration warnings) with signature int sort(). Either add a declaration or move the definition to before main().

    Possibly same problem with buildheap(), exchange() and maxheap(): I don’t recognise any of these functions.

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

Sidebar

Related Questions

I tried to write a program that uses threads, but couldn't understand the o/p.
i'm quite a beginner in C# , i tried to write a program that
I have tried to write my first Boost program from information on the Boost
I tried to write a function to check key code with JavaScript. It's working
I am doing a project, the main program write in C, it's on a
Here I have written my name in main argument declaration but still this program
I tried to write a simple c program that does something with derivatives, but
This is a K&R exercise (1-13)... Write a program to print a histogram of
I tried to write a script to list all files in directories and subdirectories
I tried to write a function that calculates a hamming distance between two codewords

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.