segmentation fault in C during scanf

后端 未结 4 1139
忘了有多久
忘了有多久 2020-12-12 08:18

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:

4条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2020-12-12 09:06

    You missed &,

    Line

    scanf("%d",amountWindowForTop);
    

    should be

    scanf("%d", &amountWindowForTop);
    //---------^
    

提交回复
热议问题