Help requested to understand a code line please

I am working on a project using a supplied file for a BMP280 pressure and temperature sensor.

Unfortunately I have very little experience with Arduino and C++ and I am failing to understand the function within following line of code?

double altitude(double P, double P0);
// convert absolute pressure to altitude (given baseline pressure; sea-level, runway, etc.)
// P: absolute pressure (mbar)
// P0: fixed baseline pressure (mbar)
// returns signed altitude in meters

I understand that it is determining altitude but what does the part of the code within brackets actually do? At first I thought that it was some mathematical function, such as +,-,* etc but I cannot figure it out??

Any help for my befuddled newbie brain would be greatly appreciated, thanks :-[

This is a prototype for the altitude function. It doesn't do anything other than tell the compiler that somewhere in your code you are going to be defining a function with this signature.

You may not be used to seeing function prototypes because the Arduino IDE automatically generates them for all functions in a .ino sketch file.

For more information, you can read the "Declaring functions" section of this page:
http://www.cplusplus.com/doc/tutorial/functions/

Thanks very much pert.

It is after midnight here so I will take a detailed look at your link in the morning and see if I can figure it all out.

Really appreciate the helpful assistance :slight_smile:

You're welcome. I hope it will be helpful. Let me know if you have any questions.