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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T02:24:12+00:00 2026-06-12T02:24:12+00:00

I am new to C programming. When I include the blank.h file into the

  • 0

I am new to C programming. When I include the blank.h file into the Test.c file the program will not compile, however when I include blank.c file into the Test.c file it compiles fine. Below is the source for all the .c and .h files. Im using gcc as my compiler, and I have a feeling I need to do some sort of linking with it? Any help would be great thanks!

This is the Test.c source

#include <stdio.h>
#include "blank.h"
#include "boolean.h"

int main()  
{
    bool result = blank("");

    printf("%d\n", result);

    return 0;
}

This is the blank.h source

// Header file for blank function

bool blank(char string[]);

This is the blank.c source

#include "boolean.h"
#include "blank.h"
#include <regex.h>

bool blank(char string[])
{

    regex_t regex_blank;
    int blank = regcomp(&regex_blank, "[:blank:]", 0);

    blank = regexec(&regex_blank, string, 0, NULL, 0);

    if  ( string == NULL || blank == 1 )
        return true;
    else
        return false;
}

and finally the boolean.h

// Boolean

// Define true
#ifndef true
#define true 1
#endif

// Define false
#ifndef false
#define false 0
#endif

typedef int bool;
  • 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-12T02:24:13+00:00Added an answer on June 12, 2026 at 2:24 am

    Ok, so I tried the source code you provided. There were a couple problems. Here are the exact steps of how I built, what I fixed. See if this works for you:

    Created 4 files in a folder: Test.c, blank.c, blank.h and boolean.h
    Copied code over.

    From the shell ran:

     gcc Test.c blank.c -o b
    

    Output:

    In file included from Test.c:2:0:
    blank.h:3:1: error: unknown type name ‘bool’
    blank.c: In function ‘blank’:
    blank.c:11:46: error: ‘NULL’ undeclared (first use in this function)
    blank.c:11:46: note: each undeclared identifier is reported only once for each function it appears in
    

    To fix the first error:
    In blank.h added this on top: #include "boolean.h"

    To fix the second error:
    In blank.c added this after the other includes: #include <stdlib.h>

    Once again the terminal ran:

     gcc Test.c blank.c -o b
    

    then from the terminal ran ./b and it prints 1.

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

Sidebar

Related Questions

I'm new to linux programming. I wrote a very simple program: #include stdio.h #include
I'm very new to programming & came across a program in a book i'm
I'm new to programming, so I want to write a code that will let
I am new to programming please help me. I need to read a file
I'm new to C++ programming. I need to sort this matrix: #include <iostream> #include
Hi, I'm very new to programming, for this program i am supposed to be
I'm new to android programming. I'm trying to include code from a non-android project
I'm new to object oriented programming in PHP. I included a class and called
What features could be added to a new programming language to make it more
let's say that you in your new programming work your boss comes and says

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.