Getting multiple values with scanf()

前端 未结 7 1145
孤街浪徒
孤街浪徒 2020-12-03 03:03

I am using scanf() to get a set of ints from the user. But I would like the user to supply all 4 ints at once instead of 4 different promps. I know I can get one value by do

7条回答
  •  一生所求
    2020-12-03 03:31

    You can do this with a single call, like so:

    scanf( "%i %i %i %i", &minx, &maxx, &miny, &maxy);
    

提交回复
热议问题