call function in .ino from external .cpp file

So my project was getting a bit too big to manage and I want to start breaking it out into separate .cpp files. I create a .ccp file for a function and that works fine. My question though is I still have a function in the .ico that gets called from a function in my external .cpp file. How do i link it?

main.ino

int functionb()
{
   return= a+b;
}

void loop ()
{
  functiona();
}

otherstuff.cpp

// what do i include up here?
// #include "main.ino"????


void functiona()
{
   z= functionb();
}

}

Assuming the .cpp and .ino are tabs in the same project (thus, they live in the same folder):

otherstuff.cpp:

int functionb();

void functiona()
{
   z= functionb();
}

You create a header file with the function prototypes you need (function declarations). The location of the implementation (function definition) doesn't matter, as long as it's available to the linker.

#include "otherstuff.h"

int functionb() {
   return= a+b;
}

void setup() {}

void loop () {
  functiona();
}
#pragma once

int functionb();
#include "otherstuff.h"

void functiona() {
   z = functionb();
}

Pieter

Am i better off creating a .h file all the main.ino functions that will be called externally like you would in ANSI C and include it in both the main.ino and otherstuff.h?

IE: a main.h

#ifndef MAIN_H
#define MAIN_H

int functionb();

#endif

You could do that, yes.