Malloc and scanf

前端 未结 5 1909
攒了一身酷
攒了一身酷 2021-01-18 19:19

I\'m fairly competent in a few scripting languages, but I\'m finally forcing myself to learn raw C. I\'m just playing around with some basic stuff (I/O right now). How can

5条回答
  •  后悔当初
    2021-01-18 19:57

    You don't need an & before toParseStr in scanf as it is already a pointer

    also call free(toParseStr) afterwards

提交回复
热议问题