Answers for "c++ defining functions in header"

C++
0

c++ define function in header

#ifndef FUNCTIONS_H_INCLUDED
#define FUNCTIONS_H_INCLUDED

int add(int a, int b)
{
   return a + b;
}

#endif
Posted by: Guest on March-31-2022
-1

how to declare a function in c++ header file

//somefile.h
#ifndef SOMEFILE_H
#define SOMEFILE_H
int add(int a, int b);
#endif
Posted by: Guest on August-20-2021

Browse Popular Code Answers by Language