Principle of C pointer (41)

Source: Internet
Author: User

C ++ boost Library

1. Install Boost in freebsd

Dp @ dp :~ % Ftp http://jaist.dl.sourceforge.net/project/boost/boost/1.55.0/boost_1_55_0.tar.gz.

Dp @ dp :~ % Tar jxvf boost_000055_0.tar.gz

Dp @ dp :~ % Su

Root @ dp:/home/dp # cd boost_000055_0

Root @ dp:/home/dp/boost_000055_0 #./bootstrap. sh

Root @ dp:/home/dp/boost_000055_0 #./bjam

Root @ dp:/home/dp/boost_000055_0 # ldconfig

Root @ dp:/home/dp/boost_000055_0 # cd ..

Test whether the installation is successful:

Dp @ dp :~ /Boostlearn % cat 1.cpp

# Include

# Include

Int main ()

{

Using boost: lexical_cast;

Int a = lexical_cast ("210923 ");

Double B = lexical_cast ("4358.56 ");

Std: cout <a <std: endl;

Std: cout <B <std: endl;

Return 0;

}

Then compile the above program:

Compile with g ++

Dp @ dp :~ /Boostlearn % g ++-o boost_test1 1.cpp-I/home/dp/boost_1_55_0

Compile with CC

Dp @ dp :~ /Boostlearn % g ++-o boost_test1 1.cpp-I/home/dp/boost_1_55_0

Note: cc and gcc compile C code files, while CC and g ++ compile C ++ code files.

Last run

Dp @ dp :~ /Boostlearn %./boost_test1

210923

4358.56

Dp @ dp :~ /Boostlearn %./boost_test2

210923

4358.56

Dp @ dp :~ /Boostlearn %

Related Article

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.