Click here to Skip to main content
14,734,433 members
Home » Discussions » C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: to bool or not to bool? Pin
Daniel Pfeffer26-Nov-20 8:17
professionalDaniel Pfeffer26-Nov-20 8:17 
QuestionEDITED Using template in C++ - run time error Pin
Member 1498043323-Nov-20 7:07
MemberMember 1498043323-Nov-20 7:07 
AnswerRe: Using template in C++ Pin
Richard MacCutchan23-Nov-20 7:25
mveRichard MacCutchan23-Nov-20 7:25 
GeneralRe: Using template in C++ Pin
Member 1498043324-Nov-20 15:34
MemberMember 1498043324-Nov-20 15:34 
GeneralRe: Using template in C++ Pin
Dave Kreskowiak24-Nov-20 20:01
mveDave Kreskowiak24-Nov-20 20:01 
GeneralRe: Using template in C++ Pin
Richard MacCutchan24-Nov-20 23:13
mveRichard MacCutchan24-Nov-20 23:13 
GeneralRe: Using template in C++ Pin
Member 1498043325-Nov-20 7:58
MemberMember 1498043325-Nov-20 7:58 
GeneralRe: Using template in C++ Pin
jeron125-Nov-20 8:23
Memberjeron125-Nov-20 8:23 
Having this;
QList<QBluetoothHostInfo> information_main;
inside the method creates a new Qlist type variable called 'information_main', this variable is totally different than the class variable called 'information_main' that has been initialized in a class constructor. This new QList variable (the one just declared inside the method) is empty because you just created it and have not added anything to it. When you make an indexed access to an empty QList variable it will fail. That's why you have to initialize (add stuff to) the new QList variable (the one just declared inside the method) to get the loop to work.
"the debugger doesn't tell me anything because this code compiles just fine" - random QA comment
"Facebook is where you tell lies to your friends. Twitter is where you tell the truth to strangers." - chriselst
"I don't drink any more... then again, I don't drink any less." - Mike Mullikins uncle

GeneralRe: Using template in C++ Pin
Richard MacCutchan25-Nov-20 8:42
mveRichard MacCutchan25-Nov-20 8:42 
GeneralRe: Using template in C++ Pin
Member 1498043325-Nov-20 9:53
MemberMember 1498043325-Nov-20 9:53 
GeneralRe: Using template in C++ Pin
Richard MacCutchan25-Nov-20 10:21
mveRichard MacCutchan25-Nov-20 10:21 
AnswerRe: Using template in C++ Pin
jeron123-Nov-20 7:41
Memberjeron123-Nov-20 7:41 
GeneralRe: Using template in C++ Pin
Member 1498043324-Nov-20 15:27
MemberMember 1498043324-Nov-20 15:27 
GeneralRe: Using template in C++ Pin
jeron124-Nov-20 15:42
Memberjeron124-Nov-20 15:42 
GeneralRe: Using template in C++ Pin
Member 1498043325-Nov-20 7:43
MemberMember 1498043325-Nov-20 7:43 
GeneralRe: Using template in C++ Pin
Richard MacCutchan25-Nov-20 8:57
mveRichard MacCutchan25-Nov-20 8:57 
GeneralRe: Using template in C++ Pin
Victor Nijegorodov25-Nov-20 10:28
MemberVictor Nijegorodov25-Nov-20 10:28 
AnswerRe: EDITED Using template in C++ - run time error Pin
Member 1498043325-Nov-20 18:39
MemberMember 1498043325-Nov-20 18:39 
GeneralRe: EDITED Using template in C++ - run time error Pin
Richard MacCutchan26-Nov-20 1:05
mveRichard MacCutchan26-Nov-20 1:05 
AnswerRe: EDITED Using template in C++ - run time error Pin
Victor Nijegorodov26-Nov-20 2:34
MemberVictor Nijegorodov26-Nov-20 2:34 
GeneralRe: EDITED Using template in C++ - run time error Pin
Member 1498043326-Nov-20 5:59
MemberMember 1498043326-Nov-20 5:59 
GeneralRe: EDITED Using template in C++ - run time error Pin
Richard MacCutchan26-Nov-20 6:48
mveRichard MacCutchan26-Nov-20 6:48 
GeneralRe: EDITED Using template in C++ - run time error Pin
Dave Kreskowiak26-Nov-20 7:28
mveDave Kreskowiak26-Nov-20 7:28 
GeneralRe: EDITED Using template in C++ - run time error Pin
Victor Nijegorodov26-Nov-20 7:50
MemberVictor Nijegorodov26-Nov-20 7:50 
AnswerRe: EDITED Using template in C++ - run time error Pin
jeron126-Nov-20 4:54
Memberjeron126-Nov-20 4:54 

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.