1
vote
Vote UpVote

Top 5 C++ language features #5 - auto

JT @ Embarcadero – auto is a new keyword in C++11 that provides automatic type inference when declaring a variable and assigning a value. Rather than having to know beforehand and specify the variable type, a C++11 developer can use auto to figure out the type for him, for example: //infers an integer auto i = 5; //infers a double auto d = 5.0; //note auto infers a double unless the f suffix is used //infers a float auto f = 5.0f; For these intrinsic types it seems overly powerful but where auto really helps simplify C++ programming is when dealing with template classes, for example, I don’t need to know ...
Favorite? Off-Topic? J T @ 2012-11-12 21:45

Statistics

Visits: 822
Votes: 1
Favorites: 0
Off-Topic: 4

Visits by Source

User Actions

Users who voted for this posting

stukelly
Subscribe:
Contact us to advertise on DelphiFeeds.com

Community Links

Torry Firebird News

Sponsor

 
Please login or register to use this functionality.
(click on this box to dismiss)