the codes below represent output of coordinates,for example it'll show faces_x=201 etc. However,they are all displayed vertically. How to print them on the console horizontally?
printf("faces_x=%d\n", faces[i].x); printf("faces_y=%d\n", faces[i].y); If you simply remove the newlines, i.e. \n, the 2 lines will be printed horizontally:
printf("faces_x=%d", faces[i].x); printf("faces_y=%d", faces[i].y); Note that your question doesn't actually need the second \n to be removed, unless you want the following output to start on a new line.
\ns?std::cout << "faces_x=" << faces[i].x << " faces_y=" << faces[i].y;Some delimiter, a space or a newline most likely, may be needed on the end to distinguish one set of data from the next.