My favorites | Sign in
Project Home Downloads Wiki Issues Source
Search
for
Hex  
Example showing format manipulators to enter hex numbers
Updated Nov 14, 2011 by hugo.arregui

The following example shows format manipulators usage to enter hex numbers.

int main(int argc, char* argv[])
{
	int i;
	
	GetOpt_pp ops(argc, argv);
	
	ops >> std::hex >> Option('i', "number", i);
	
	std::cout << std::hex << "Number entered: (hex)" << i << " (dec)" << std::dec << i << std::endl;
	
	return 0;
}

Sign in to add a comment
Powered by Google Project Hosting