Click here to Skip to main content
15,851,242 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Clang/LLVM support in Visual Studio projects Pin
jschell3-Feb-23 6:01
jschell3-Feb-23 6:01 
QuestionInverted linked list in C Pin
Amine Saber28-Jan-23 22:23
Amine Saber28-Jan-23 22:23 
AnswerRe: Inverted linked list in C Pin
Richard MacCutchan28-Jan-23 23:42
mveRichard MacCutchan28-Jan-23 23:42 
QuestionRe: Inverted linked list in C Pin
David Crow29-Jan-23 13:56
David Crow29-Jan-23 13:56 
QuestionMessage Closed Pin
24-Jan-23 11:52
Member 1496877124-Jan-23 11:52 
AnswerRe: Basic C++ - can you explain the difference / function of each definition ? Pin
k505424-Jan-23 12:10
mvek505424-Jan-23 12:10 
GeneralMessage Closed Pin
24-Jan-23 13:09
Member 1496877124-Jan-23 13:09 
GeneralRe: Basic C++ - can you explain the difference / function of each definition ? Pin
k505424-Jan-23 13:32
mvek505424-Jan-23 13: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

GeneralRe: Basic C++ - can you explain the difference / function of each definition ? Pin
Richard MacCutchan25-Jan-23 0:49
mveRichard MacCutchan25-Jan-23 0:49 
AnswerRe: Basic C++ - can you explain the difference / function of each definition ? Pin
Graham Breach24-Jan-23 12:30
Graham Breach24-Jan-23 12:30 
AnswerRe: Basic C++ - can you explain the difference / function of each definition ? Pin
Richard MacCutchan24-Jan-23 23:26
mveRichard MacCutchan24-Jan-23 23:26 
AnswerRe: Basic C++ - can you explain the difference / function of each definition ? Pin
jschell25-Jan-23 6:08
jschell25-Jan-23 6:08 
GeneralRe: Basic C++ - can you explain the difference / function of each definition ? Pin
Richard MacCutchan25-Jan-23 6:21
mveRichard MacCutchan25-Jan-23 6:21 
AnswerRe: Basic C++ - can you explain the difference / function of each definition ? Pin
charlieg28-Jan-23 9:57
charlieg28-Jan-23 9:57 
GeneralMessage Closed Pin
29-Jan-23 4:57
Member 1496877129-Jan-23 4:57 
GeneralRe: Basic C++ - can you explain the difference / function of each definition ? Pin
charlieg1-Feb-23 5:20
charlieg1-Feb-23 5:20 
QuestionQueryThreadCycleTime, QueryProcessCycleTime: what do these number mean? Pin
peterchen24-Jan-23 1:34
peterchen24-Jan-23 1:34 
AnswerRe: QueryThreadCycleTime, QueryProcessCycleTime: what do these number mean? Pin
Richard MacCutchan24-Jan-23 1:44
mveRichard MacCutchan24-Jan-23 1:44 
AnswerRe: QueryThreadCycleTime, QueryProcessCycleTime: what do these number mean? Pin
CPallini24-Jan-23 3:02
mveCPallini24-Jan-23 3:02 
GeneralRe: QueryThreadCycleTime, QueryProcessCycleTime: what do these number mean? Pin
Richard MacCutchan24-Jan-23 3:20
mveRichard MacCutchan24-Jan-23 3:20 
GeneralRe: QueryThreadCycleTime, QueryProcessCycleTime: what do these number mean? Pin
CPallini24-Jan-23 3:32
mveCPallini24-Jan-23 3:32 
AnswerRe: QueryThreadCycleTime, QueryProcessCycleTime: what do these number mean? Pin
Randor 24-Jan-23 4:49
professional Randor 24-Jan-23 4:49 
GeneralRe: QueryThreadCycleTime, QueryProcessCycleTime: what do these number mean? Pin
harold aptroot24-Jan-23 9:42
harold aptroot24-Jan-23 9:42 
QuestionRe: QueryThreadCycleTime, QueryProcessCycleTime: what do these number mean? Pin
Randor 24-Jan-23 10:06
professional Randor 24-Jan-23 10:06 
GeneralRe: QueryThreadCycleTime, QueryProcessCycleTime: what do these number mean? Pin
harold aptroot24-Jan-23 10:26
harold aptroot24-Jan-23 10:26 

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.