Search
 
SCRIPT & CODE EXAMPLE
 

C

inline function in c example

// file test.h
#ifndef TEST_H_INCLUDED
#define TEST_H_INCLUDED
inline int sum (int a, int b)
{
    return a+b;
}
#endif
 
// file sum.c
#include "test.h"
extern inline int sum (int a, int b); // provides external definition
 
// file test1.c
#include <stdio.h>
#include "test.h"
extern int f(void);
 
int main(void)
{
    printf("%d
", sum(1, 2) + f());
}
 
// file test2.c
#include "test.h"
 
int f(void)
{
    return sum(2, 3);
}
Comment

inline function in c example

// file test.h
#ifndef TEST_H_INCLUDED
#define TEST_H_INCLUDED
inline int sum (int a, int b)
{
    return a+b;
}
#endif
 
// file sum.c
#include "test.h"
extern inline int sum (int a, int b); // provides external definition
 
// file test1.c
#include <stdio.h>
#include "test.h"
extern int f(void);
 
int main(void)
{
    printf("%d
", sum(1, 2) + f());
}
 
// file test2.c
#include "test.h"
 
int f(void)
{
    return sum(2, 3);
}
Comment

PREVIOUS NEXT
Code Example
C :: sdl close ev 
C :: gotoxy not working in dev c++ 
C :: email dev Microsoft Outlook 2007 items all aligned left or aligned wrong 
C :: c addition 
C :: Returns number of values 
C :: i765 OPT filing fees october 2 
C :: function pointer in c 
C :: nosql injection 
C :: calculate max of three numbers using ternary operator in c 
C :: C Increment and Decrement Operators 
C :: c while loop 
C :: c triangle check if triangle is 90 degrees 
Dart :: flutter get width of screen 
Dart :: flutter elevated button radius 
Dart :: rel canonical tag 
Dart :: How to center AlertDialog FlatButton in Flutter 
Dart :: how to change color in container flutter 
Dart :: scroll to top flutter 
Dart :: flutter get device width 
Dart :: flutter substring 
Dart :: not empty string check dart 
Dart :: flutter string contains 
Dart :: flutter print line char limit 
Dart :: changing the textbutton padding in flutter 
Dart :: flutter duration to string 
Dart :: how to give bottom padding in Listview in flutter 
Dart :: unable to locate android sdk flutter in windows 
Dart :: flutter get package command 
Dart :: flutter datetime 
Dart :: android studio emulator blue screen windows 10 
ADD CONTENT
Topic
Content
Source link
Name
7+4 =