Getting multiple values with scanf()

前端 未结 7 1137
孤街浪徒
孤街浪徒 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);
    
    0 讨论(0)
提交回复
热议问题