I am trying to scan in an integer to use for my program. However my program gives me segmentation fault during compilation this is the section that is giving me the error:
You missed & in
scanf("%d",amountWindowForTop);
this must be
scanf("%d",&amountWindowForTop);
Cause of error is & is called address of operator so missing it in scanf means where are you put your value means address is required because it specify the address of variable where we have to keep the value. segmentation fault error is generally we get whenever their is any problem related with address. Hope useful for you.
You missed &
in
scanf("%d", amountWindowForTop);
^Place & operator
You are missing the &
scanf("%d",&amountWindowForTop);
^
You missed &
,
Line
scanf("%d",amountWindowForTop);
should be
scanf("%d", &amountWindowForTop);
//---------^