problem with array transport between programs
I'm triyng to use an older program of mine as a function of a new one i made but instead of just coping the code of the older to the new i wanted to use they as separeted files, i writed the codes i tought would be enough for this task and compilated the new one as main.c and the older as function.o with gcc but i'm geting a giant stray error, gonna post the coded and ask if any of you can help me, i'm doing this on linux.
main.c
Code:
#include <stdio.h>
#include "function.o"
#define N 4000
void function( float Sx[], float h[], float Cor[][4], int PontosSpec, int v );
int main()
{
int v, j, NumeroEspectros, PontosSpec, q;
char L[N][1000];
signed char x[N][1000];
float Sx[N], h[N], c[N], Cor[N][4];
...
function(Sx, h, Cor, PontosSpec, v);
...
}
function.o
Code:
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
#define N 4000
void function( float Sx[], float h[], float Cor[][4], int PontosSpec, int v )
{
int i,j,q,NumeroPontosS, NumeroPontos ;
float y[N+1],p[N+1], o[N+1],l[N+1],z[N],x[N+1],a,b, Sy[N];
...
Cor = ...;
}
I know the problem is in the link because both programs work fine when separated, i'm using "gcc main.c function.o -o prog" to compilate both in an executable, the awnser i need is the "Cor'' parameter, I'm getting errors like this in a lot of lines in the function when tryiyng to compilate:
error: stray ‘\374’ in program
error: stray ‘\377’ in program
...