How to include source code in external files

Sorry, I'm just learning to use Arduino here...

I want to load my sketch with some data. Thought the easiest way would be to include it as an external source file. I.e.:

#include "arraydata.c"

However, I get the following compilation error:

All_on_test2.ino:64:23: fatal error: arraydata.c: No such file or directory
compilation terminated.

I put the file arraydata.c in the sketch directory. And I checked the Sketch Directory using the menu:
/Users/billtubbs/Documents/Arduino/Test scripts/All_on_test2

I also checked in preferences. My sketchbook location is:
/Users/billtubbs/Documents/Arduino

Is this the right approach and if so, where should I put the external source file so I can include it?
thanks

What does arraydata.c look like? Why are you using a .c extension with a cpp compiler?

Good point on the extension. I should use cpp.

arraydata.c just contains a lot of intialisation data:

double centresVec[] =
	{ 
         4.38068342e+02,   8.60845689e+00,   2.63405209e+02,
         3.09490219e+02,   2.56739220e+02,   2.11593726e+02,
         3.89195671e+02,   2.40565525e+02,   3.33953119e+02,
         4.61564933e+02,   6.18479779e+01,   1.04356549e+02,
         1.63476915e+02,   9.96386250e+01,   4.34573849e+02,
         1.93720377e+02,   6.52228885e+00,   3.66242500e+02,
         3.78999822e+02,   3.80939221e+02,   7.11503540e+01,
         4.13357781e+02,   5.49764416e+01,   1.16728441e+02,
         3.44735141e+02,   4.26844759e+02,   3.91494372e+02,
         4.72744692e+02,   3.88618463e+02,   9.46198944e+01,
         2.64196885e+02,   1.12261566e+02,   2.30924650e+02,
         2.95890888e+01,   3.02882887e+02,   5.12834302e+01,
         3.02617632e+02,   2.08826761e+02,   7.27609981e+00,
         4.34555734e+02,   1.26780770e+02,   5.39963693e+01,
         2.81247757e+02,   2.34019648e+02,   4.37422313e+02,
         2.32197785e+02,   3.38010940e+02,   3.95179744e+01,
         3.49483568e+02,   1.13649857e+02,   1.39629823e+02,
         2.85783466e+02,   2.57112780e+02,   1.56724095e+02,
         4.52452976e+02,   2.81819731e+02,   3.84918001e+02,
         1.87429148e+02,   1.65979552e+02,   2.84161634e+02,
         5.55842972e+01,   1.48292444e+02,   4.25359841e+02,
         2.08961431e+02,   3.44900076e+02,   3.32122639e+02,
         1.05232780e+01,   1.63930163e+02,   4.39015346e+00,
         2.58567467e+02,   7.46792232e+01,   7.89210643e+01,
         3.15529863e+02,   1.79628936e+02,   3.83239280e+02,
         2.14213988e+02,   1.75308643e+02,   2.86856073e+02,
         8.05995519e+01,   4.39059841e+02,   1.62792236e+02,
         1.60872716e+02,   2.26187015e+02,   3.87088206e+02,
         4.32324279e+02,   2.07808525e+02,   4.83148812e+01,
         2.36106493e+01,   9.88745472e+01,   3.31228585e+02,
         3.34225310e+02,   1.26940314e+02,   6.08568920e+00,
         1.52218690e+02,   1.56584199e+02,   3.01342694e+01,
         4.10982560e+02,   7.95008891e+01,   2.75728162e+02,
         1.65583129e+02,   1.35695634e+02,   1.23195284e+02,
         2.63443485e+02,   3.90941277e+02,   3.66329535e+02,
         3.81292756e+02,   1.43568785e+02,   2.03751294e+02,
         1.45499101e+02,   5.17349563e+01,   2.69749782e+02,
         3.77904102e+02,   2.14493034e+02,   2.24567404e+02,
         2.50832594e+02,   1.79458994e+02,   4.13495107e+02,
         2.60813735e+01,   3.90489574e+02,   4.26822470e+02,
         3.15877395e+02,   4.89584640e+01,   3.17034632e+02,
         2.69876235e+02,   4.53618983e+00,   2.30631668e+02,
         2.49378647e+02,   6.01986457e+01,   1.29056171e+02,
         1.36348854e-01,   9.61986256e+01,   2.06307991e+02,
         1.00746082e+02,   5.15430605e+01,   3.42658169e+02,
         2.21351807e+02,   3.18946587e+02,   4.89714794e+01,
         3.68029091e+02,   1.71741577e+02,   2.96721807e+02,
         7.74630093e+01,   1.94070071e+02,   3.32599196e+02,
         1.19912724e+02,   4.61024893e+02,   1.04904856e+02,
         4.25476360e+02,   3.68079874e+02,   1.14543306e+02,
         3.32578871e+02,   1.96283723e+02,   3.17717011e+02,
         2.92989731e+00,   1.54904414e+02,   2.97991397e+02,
         4.10926688e+02,   4.47463365e+02,   2.20598608e+02,
         2.43823037e+00,   7.27433541e+00,   3.75361619e+02,
         4.11727714e+02,   4.38167765e+02,   4.07574471e+01,
         2.67281093e+02,   2.39127206e+02,   3.26668686e+02,
         2.81398221e+01,   5.77584669e+01,   1.70777914e+02,
         2.71444179e+02,   4.75584034e+02,   4.35514239e+02,
         2.86375055e+02,   1.82003289e+02,   4.77545723e+02,
         3.46073647e+02,   4.59657050e+02,   7.76659526e+01,
         4.31976534e+02,   9.32291354e+01,   3.65028793e+02,
         3.14051480e+02,   2.45502823e+02,   1.06017899e+02
	};

I just discovered tabs in the Arduino compiler! I guess I should paste the contents of array data.cpp into one of these tabs and let the compiler create the file?

62 * 3 * 4 = 744 bytes. That's a lot of SRAM being wasted for what is likely constant data.

It COULD be in a .h file, and it could be in PROGMEM.

Using tabs is not as easy as I thought for this since all tabs are compiled in order. This forum post has the answer:

Behaviour of Multiple Tabs in IDE & compilation

I changed array data.cpp to a header file (array data.h) and now the #include command works and it doesn't try to build the file in the second tab again.

thanks PaulS and MechatronicsGuy!

Thanks for that, I'll look into PROGMEM.