Program received signal SIGSEGV, Segmentation fault

Pages: 123
@ne555: I am still working on the code... the previous problems seem to have been solved, but there's an error that I am not able to figure out how to solve:

E:\BC\Courses\Pablo_Methods\HW\Mendoza 2010 Replication\Lia Replication\main.cpp: In function 'int main()':
E:\BC\Courses\Pablo_Methods\HW\Mendoza 2010 Replication\Lia Replication\main.cpp:1328:841: error: cannot convert 'double (*)[2][8]' to 'double*' for argument '134' to 'void correlations(double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double (*)[2][8], double (*)[2][8], double, double (*)[2][8], double, double (*)[2][8], double, double (*)[2][8], double, double*, double, double*, double, double*, double, double (*)[2][8], double, double (*)[2][8], double, double (*)[2][8], double, double (*)[2][8], double, double (*)[2][8], double, double (*)[2][8], double, double (*)[2][8], double, double (*)[2][8], double, double (*)[2][8], double, double (*)[2][8], double, double (*)[2][8], double, double (*)[2][8], double, double (*)[2][8], double, double (*)[2][8], double, double*, double, double (*)[2][8], double*, double, double (*)[2][8], double, double (*)[2][8], double)'
correlations(ysd,ksd,bsd,solwrsd,ygsd,vcsd,srsd,sesd,spsd,wksd,wkdgosd,rtpvar,bcansd,savsd,gnpsd,casd2,cayrsd2,tbsd2,tbyrsd2,lsd,ylsd,csd,invsd,savinvc,yygc,ysolwrc,ycc,yvcc,ywkc,ywkdgoc,yinvc,ylc,ysrc,ysec,solwrsec,yspc,yepc,yac,yafc,ycac,ycayrc,ytbc,ytbyrc,yylc,ykc,kllsd,yllsd,ykllc,yyllc,ygnpc,sy,ssolwr,syg,svc,ssr,sse,ssp,swk,swkdgo,srtp,sbcan,ssav,sgnp,sca,scayr,stb,stbyr,sl,syl,sc,sinv,ysdp,solwrsdp,vcsdp,wksdp,wkdgosdp,gnpsdp,casd,cayrsd,tbsd,tbyrsd,lsdp,ylsdp,csdp,invsdp,savsdp,srsdp,sesdp,spsdp,ylkllc,pkve,y,ym,solwr,solwrm,yg,ygm,vcopt,vcm,sr,srm,sa,sem,sp,spm,wk,wkm,wkdgo,wkdgom,VA,rtpm,bcan,bcanm,sav,savm,rr,gnpm,ca,cam,pka1,cayrm,tb,tbm,pka2,tbyrm,lopt,lm,yl,ylm,c,cm,inv,invm,y,ym,solwr,solwrm,yg,ygm,vcopt,vcm,sr,srm,sa,sem,sp,spm,wk,wkm,wkdgo,wkdgom,VA,rtpm,bcan,bcanm,sav,savm,bond,bm,bbn,k,km,kll,kllm,yll,yllm);
^
It looks as though there's a mismatch between the type of data you're trying to pass into that function, and the type of data it's expecting.

Also, if you have a function that requires that many arguments, you're doing something seriously wrong!

Obviously, without seeing the actual code, it's hard to say more. But, seriously, just from the info in that error message, it's clear you badly need to rework the design of your code.
@MikeyBoy: I was able to find the mistake, thanks!

I suspected that it was kinda too many terms, but I am just learning about functions. Perhaps I should make use of structures? At the moment I don't know how to use structures, only heard about them.
Last edited on
You're welcome :)

Yeah, it definitely sounds as though you could use some organisation of that data, either into structures, or collections, as appropriate.

Why on earth do you need to pass so many arguments into that function?
@MikeyBoy: I will look into structures and collections. I am trying to calculate a lot of summary statistics using different functions.
Topic archived. No new replies allowed.
Pages: 123