VC Support 16 (16) in-system string conversion to numeric function strtoul__ function

Source: Internet
Author: User

1. See the example directly:

	Char str[100] = "AB12";	or "0xab12" can be
	unsigned long x = Strtoul (str, NULL,);	Get the x= 0xab12

If you can't remember the function name Strtoul, search for "Atoi" on MSDN, the bottom of the also is


2. To see the high version vs, support for 64-bit 16-string conversion: _strtoui64

Char str[100] = "10446744073709551615";
unsigned __int64 u =_strtoui64 (str, NULL, n);
printf ("10-binary string conversion result: \ r \ n");
printf ("U =%i64u\n", u);
printf ("U = 0x%i64x\n\n", u);

printf ("16-binary string conversion result: \ r \ n");
strcpy (str, "0x90fa4a62c4dfffff");
U =_strtoui64 (str, NULL,);
printf ("U =%i64u\n", u);
printf ("U = 0x%i64x\n\n", u);






Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.