Feb 9, 2014. I'm new here, sorry if I'm doing this wrong. I keep getting two errors when I try to compile: functions.cpp(126): error C2082: redefinition of formal parameter 'dive' and functions.cpp(127): error C2082: redefinition of formal parameter 'difficulty' I don't know what is wrong and I'm new at c++ so I'm asking for.

Scenario is I have a function which calls parameterized constructor when I want to initialize. So what I want to do is to call constructor of my choice when I want.

Apr 25, 2014. In your member function i you're trying to call the c'tor of A like this: void i(int tmp) { A(tmp); }. In fact A(tmp) declares a variable tmp of type A. Since tmp is already declared as int inside the same scope, the compiler complains. If you want a variable of type A and initialize it via the A::A(int) c'tor then you need.

The new home for Visual Studio documentation is Visual Studio 2017 Documentation on docs.microsoft.com. The latest version of this topic can be found at Compiler.