Home
Blogs
Questions
Jobs
Monetize

Home

About Us

Blogs

Questions

Jobs

Monetize

Post Job

banner

Questions about compiler-directives

Read more about compiler-directives

python (12.9k questions)

javascript (9.2k questions)

reactjs (4.7k questions)

java (4.2k questions)

java (4.2k questions)

c# (3.5k questions)

c# (3.5k questions)

html (3.3k questions)

Questions - compiler-directives

Why only include header files (.h) but not the source file (.c) in the directives?

How does the compiler know which source file is the one I am including? Does it work as long as the name of the header and source file are the same? For example, the header file example.h refers to ex...
test-img

Captain Toad

c

module

header-files

preprocessor

compiler-directives

c

module

header-files

preprocessor

compiler-directives

Votes: 0

Answers: 1

Latest Answer

How does the compiler know which source file is the one I am including? It doesn’t. The compiler only knows what you tell it. Header files are designed to tell the compiler what exists elsewhere. D...
test-img

Dúthomhas

Compiler says variables declared within compiler directive doesnt exist

Suppose I have this code (all in the same class): #if CONDITION private static readonly string firstName = "First Name"; #endif string GetName(){ #if CONDITION return firstN...
test-img

Daniel

c#

compiler-directives

Votes: 0

Answers: 0

Posts

Questions

Blogs

Jobs

The ultimate platform for coders and IT specialists

About

  • Company
  • Support

  • Platform

  • Terms & Conditions
  • Privacy statement
  • Cookie policy
  • Cookie option
  • OnlyCoders © 2025  |  All rights reserved