Does the multifile feature work with C?

+4 votes
asked Sep 22, 2019 by Mike (160 points)
I created a file called "hello.h" with the code below, but on running get an error that hello.h couldn't be found. Am I missing something?

#include <stdio.h>
#include <hello.h>

int main ()
{
  printf ("Hello World");

  return 0;
}

Thanks in advance!

3 Answers

0 votes
answered Sep 22, 2019 by Admin (4,350 points)
How did you create hello.h file?
0 votes
answered Sep 23, 2019 by anonymous
A header file is a file containing C declarations and macro definitions to be shared between source files

It would be     #include "hello.h"     since that header file you created the H file yourself.

<.h> are system header files

Currently, your code doesn't require that header file you've created since it's just printing Hello World. If it does require that header file, there is a mistake in that header file that we can't see.
0 votes
answered Sep 30, 2019 by Pradeep Behara
here the header file hello.h is not necessary. if you want to do it. you should create a header file in advance.
Welcome to OnlineGDB Q&A, where you can ask questions related to programming and OnlineGDB IDE and and receive answers from other members of the community.
...