Click here to Skip to main content
15,891,431 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: Compilers Pin
BernardIE53179-Feb-23 8:51
BernardIE53179-Feb-23 8:51 
QuestionMessage Closed Pin
1-Feb-23 14:01
Member 149687711-Feb-23 14:01 
AnswerRe: English , please.... Pin
Victor Nijegorodov1-Feb-23 20:25
Victor Nijegorodov1-Feb-23 20:25 
QuestionRe: English , please.... Pin
CPallini1-Feb-23 20:50
mveCPallini1-Feb-23 20:50 
AnswerRe: English , please.... Pin
Richard MacCutchan1-Feb-23 21:07
mveRichard MacCutchan1-Feb-23 21:07 
AnswerRe: English , please.... Pin
Calin Negru2-Feb-23 1:03
Calin Negru2-Feb-23 1:03 
AnswerRe: English , please.... Pin
Gerry Schmitz2-Feb-23 6:57
mveGerry Schmitz2-Feb-23 6:57 
GeneralRe: English , please.... Pin
Richard MacCutchan3-Feb-23 1:08
mveRichard MacCutchan3-Feb-23 1:08 
AnswerRe: English , please.... Pin
k50542-Feb-23 9:18
mvek50542-Feb-23 9:18 
QuestionClang/LLVM support in Visual Studio projects Pin
ForNow31-Jan-23 10:25
ForNow31-Jan-23 10:25 
AnswerRe: Clang/LLVM support in Visual Studio projects Pin
Dave Kreskowiak31-Jan-23 10:54
mveDave Kreskowiak31-Jan-23 10:54 
AnswerRe: Clang/LLVM support in Visual Studio projects Pin
Mircea Neacsu31-Jan-23 12:18
Mircea Neacsu31-Jan-23 12:18 
GeneralRe: Clang/LLVM support in Visual Studio projects Pin
ForNow31-Jan-23 12:44
ForNow31-Jan-23 12:44 
GeneralRe: Clang/LLVM support in Visual Studio projects Pin
Mircea Neacsu31-Jan-23 12:54
Mircea Neacsu31-Jan-23 12:54 
GeneralRe: Clang/LLVM support in Visual Studio projects Pin
ForNow31-Jan-23 12:56
ForNow31-Jan-23 12:56 
GeneralRe: Clang/LLVM support in Visual Studio projects Pin
jschell2-Feb-23 7:53
jschell2-Feb-23 7:53 
GeneralRe: Clang/LLVM support in Visual Studio projects Pin
Mircea Neacsu2-Feb-23 8:03
Mircea Neacsu2-Feb-23 8:03 
GeneralRe: Clang/LLVM support in Visual Studio projects Pin
jschell3-Feb-23 5:01
jschell3-Feb-23 5:01 
QuestionInverted linked list in C Pin
Amine Saber28-Jan-23 21:23
Amine Saber28-Jan-23 21:23 
AnswerRe: Inverted linked list in C Pin
Richard MacCutchan28-Jan-23 22:42
mveRichard MacCutchan28-Jan-23 22:42 
QuestionRe: Inverted linked list in C Pin
David Crow29-Jan-23 12:56
David Crow29-Jan-23 12:56 
QuestionMessage Closed Pin
24-Jan-23 10:52
Member 1496877124-Jan-23 10:52 
AnswerRe: Basic C++ - can you explain the difference / function of each definition ? Pin
k505424-Jan-23 11:10
mvek505424-Jan-23 11:10 
GeneralMessage Closed Pin
24-Jan-23 12:09
Member 1496877124-Jan-23 12:09 
GeneralRe: Basic C++ - can you explain the difference / function of each definition ? Pin
k505424-Jan-23 12:32
mvek505424-Jan-23 12:32 
Every C++ class has a constructor that gets called when the object is created. So if we have
C++
class C {
public:
   int n;
   C() { n = -1; }
}

int main()
{
    C c;  // C:C() gets called here, assigning -1 to n;
    std::cout << c.n << '\n'; // will print -1
}

In the class C given above, if you do not give a default constructor, then the compiler will provide one, but it will not initialize the value of C.n
C++
class C {
public:
   int n;
};

int main()
{
   C c; // compiler provided constructor called
   std::cout << c.n << '\n'; // This generates a warning with -Wall (gcc) that n is unititalized
}
Presumably class QBluetoothLocalDevice provides a default constructor that fills in reasonable default values for its members. If some of those members use system resources (e.g. open file handles, memory, etc), then there is also a destructor that gets called when the object goes out of scope to release the resources (e.g close open files, release memory, etc).
Keep Calm and Carry On

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.