문제

I understand that you can use iomanip to set a precision flags for floats (e.g. have 2.0000 as opposed to 2.00).

Is there a way possible to do this, for integers?

I would like a hex number to display as 000e8a00 rather than just e8a00 or 00000000 rather than 0.

Is this possible in C++, using the standard libraries?

도움이 되었습니까?

해결책

기본 키 선언의 순서입니다.항상 place_id를 검색하는 경우 먼저 post_id를 선언하십시오.

PRIMARY KEY (place_id, post_id)
.

다른 팁

You can also do this with boost::format, which I find often saves typing:

std::cout << boost::format("%08x\n") % 0xe8a00;

It also allows for some nice code reuse, if you have multiple places you need to do the same formatting:

boost::format hex08("%08x");
std::cout << hex08 % 0xe8aa << std::endl;
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top