C Sharppragma - C Programming Tutorial
C Course / Preprocessor / C Sharppragma

C Sharppragma

BLUF: Understanding C Sharppragma is a foundational part of learning C programming. This tutorial explains the core principles and syntax needed to implement this concept effectively.
Core Programming Principle: C Sharppragma

C provides direct access to memory and system resources. Learn how C Sharppragma leverages this power in the lesson below.

C #pragma

Example

#pragma token

Various compilers may offer distinct implementations of the #pragma directive.

The turbo C++ compiler is compatible with the following #pragma directives.

Example

#pragma argsused
#pragma exit
#pragma hdrfile
#pragma hdrstop
#pragma inline
#pragma option
#pragma saveregs
#pragma startup
#pragma warn

Let's explore a basic illustration demonstrating the utilization of the #pragma preprocessor directive.

Example

Example

#include<stdio.h>
#include<conio.h>

void func() ;

#pragma startup func
#pragma exit func

void main(){
printf("\nI am in main");
getch();
}

void func(){
printf("\nI am in func");
getch();
}

Output:

Output

I am in func
I am in main
I am in func

Input Required

This code uses input(). Please provide values below:

Logic Practice
Install Logic Practice
Add to home screen for a faster app-like experience