int a = 0;
and int a(0);
make no difference in the machine generated code. They are the same.
Following is the assembly code generated in Visual Studio
int a = 10; // mov dword ptr [a],0Ah
int b(10); // mov dword ptr [b],0Ah
Related Contents:
- How to check that an element is in a std::set?
- What is std::promise?
- Return array in a function
- Why is ‘this’ a pointer and not a reference?
- How to create a template function within a class? (C++)
- What is the worst real-world macros/pre-processor abuse you’ve ever come across?
- C++, copy set to vector
- Is “long long” = “long long int” = “long int long” = “int long long”?
- CMake unable to determine linker language with C++
- Cannot find or open the PDB file in Visual Studio C++ 2010
- C99 stdint.h header and MS Visual Studio
- How to clear ostringstream [duplicate]
- Why is it impossible to build a compiler that can determine if a C++ function will change the value of a particular variable?
- Compilation fails with “relocation R_X86_64_32 against `.rodata.str1.8′ can not be used when making a shared object”
- How do I pass multiple ints into a vector at once?
- Which C++ standard is the default when compiling with g++?
- Has the new C++11 member initialization feature at declaration made initialization lists obsolete?
- char* vs std::string in c++ [closed]
- How to define different types for the same class in C++
- Initializing variables in an “if” statement
- Performance of qsort vs std::sort?
- Is there any ‘out-of-the-box’ 2D/3D plotting library for C++? [closed]
- virtual inheritance [duplicate]
- Is it legal for a C++ optimizer to reorder calls to clock()?
- Convert Eigen Matrix to C array
- What are the differences between C-like, constructor, and uniform initialization?
- Is there a way to pass auto as an argument in C++?
- Constexpr Math Functions
- How to get IOStream to perform better?
- In clang-format, what do the penalties do?
- Should all/most setter functions in C++11 be written as function templates accepting universal references?
- How to get the CPU cycle count in x86_64 from C++?
- How does Eric Niebler’s implementation of std::is_function work?
- Why is the destructor called for an object that is not deleted?
- What can C++ offer as far as functional programming?
- Calculate rolling / moving average in C++
- Is it possible to get a pointer to one subobject via a pointer to a different, unreleated subobject?
- In C/C++, is there a directive similar to #ifndef for typedefs?
- How to get Python exception text
- Decrypt password created with htpasswd
- Is it ok to read a shared boolean flag without locking it when another thread may set it (at most once)?
- Difference between hash_map and unordered_map?
- templates: parent class member variables not visible in inherited class
- Always declare std::mutex as mutable in C++11?
- C++ delete syntax
- Linker error LNK2038: mismatch detected in Release mode
- inline template function?
- I defined a non-copy constructor; will a copy constructor still be implicitly defined?
- Can I obtain C++ type names in a constexpr way?
- How do YOU reduce compile time, and linking time for Visual C++ projects (native C++)?