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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T08:03:38+00:00 2026-06-10T08:03:38+00:00

I know this question has been asked elsewhere but reading the already given answers

  • 0

I know this question has been asked elsewhere but reading the already given answers is not helping me. My code is ridiculously simple yet I cannot compile it. I’m writing code to build a stack.

Here is my stack.h:

#ifndef GUARD
#define GUARD

struct Stack {

    struct Stack* next;
    int           data;
};
extern bool isempty (struct Stack*);

#endif

here is my stack.c:

#include <stdio.h>
#include <stdlib.h>

#include "stack.h"

bool isempty (struct Stack* st) {

    return (st == NULL);
}

The compiler keeps on complaining about this line:

extern bool isempty (struct Stack*);

The contents of my main.c are irrelevant (for now it just returns 0). Does anyone understand what I am doing wrong?

  • 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-10T08:03:40+00:00Added an answer on June 10, 2026 at 8:03 am

    The type bool is generally not available in C.

    If your compiler supports C99, you can add

    #include <stdbool.h>
    

    to make it available, though.

    UPDATE: Use of C99 is, in my opinion, not exactly pervasive in C programs “in the large”, no. Most boolean values, such as function returns, are represented as int, which is how it has been solved classically. For arrays, you’d be quite likely to find them represented as bits packed into e.g. unsigned int, rather than e.g bool a[32];.

    But, in an interview context, I think it would be pretty nice for a candidate to write the above without flinching. It was standardized 13 years ago, after all.

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

Sidebar

Related Questions

I know this question has been asked before, but none of the previous answers
I know this question has been asked before but the solutions did not work
I know this question has been asked lots of times, but I am not
I know this question has been asked a lot, but not yet to my
I know this question has been asked many times, but I have not been
I know this question has been asked before, but many answers don't give clear
I know this question has been asked before however the answers I found where
I know this question has been asked before, but non of the solutions solve
I know this question has been asked a zillion times, but I still feel
I know this question has been asked before, but I haven't been able to

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.