Click here to Skip to main content
15,904,823 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: c program Pin
Stefan_Lang30-Oct-14 0:20
Stefan_Lang30-Oct-14 0:20 
Question"Network Access: Allow anonymous SID/Name translation" ,a am attempting to get this via the registry but cant find the key,how can I get thisvalue ,tks Pin
kxjhcs25-Oct-14 21:04
kxjhcs25-Oct-14 21:04 
AnswerRe: "Network Access: Allow anonymous SID/Name translation" ,a am attempting to get this via the registry but cant find the key,how can I get thisvalue ,tks Pin
Richard MacCutchan25-Oct-14 22:13
mveRichard MacCutchan25-Oct-14 22:13 
QuestionHow to constructor a storage class to store Tree data in C++ Pin
shanmugarajaa25-Oct-14 5:20
shanmugarajaa25-Oct-14 5:20 
AnswerRe: How to constructor a storage class to store Tree data in C++ Pin
Richard MacCutchan25-Oct-14 5:54
mveRichard MacCutchan25-Oct-14 5:54 
GeneralRe: How to constructor a storage class to store Tree data in C++ Pin
shanmugarajaa25-Oct-14 7:54
shanmugarajaa25-Oct-14 7:54 
GeneralRe: How to constructor a storage class to store Tree data in C++ Pin
Richard MacCutchan25-Oct-14 22:09
mveRichard MacCutchan25-Oct-14 22:09 
GeneralRe: How to constructor a storage class to store Tree data in C++ Pin
Orjan Westin27-Oct-14 3:54
professionalOrjan Westin27-Oct-14 3:54 
GeneralRe: How to constructor a storage class to store Tree data in C++ Pin
Richard MacCutchan27-Oct-14 7:41
mveRichard MacCutchan27-Oct-14 7:41 
GeneralRe: How to constructor a storage class to store Tree data in C++ Pin
Orjan Westin27-Oct-14 23:13
professionalOrjan Westin27-Oct-14 23:13 
GeneralRe: How to constructor a storage class to store Tree data in C++ Pin
Richard MacCutchan27-Oct-14 23:56
mveRichard MacCutchan27-Oct-14 23:56 
AnswerRe: How to constructor a storage class to store Tree data in C++ Pin
Orjan Westin27-Oct-14 3:52
professionalOrjan Westin27-Oct-14 3:52 
AnswerRe: How to constructor a storage class to store Tree data in C++ Pin
Stefan_Lang27-Oct-14 4:25
Stefan_Lang27-Oct-14 4:25 
AnswerRe: How to constructor a storage class to store Tree data in C++ Pin
Vaclav Naydenov28-Oct-14 11:42
Vaclav Naydenov28-Oct-14 11:42 
QuestionCannot initialize array of classes except as a local variable. Pin
Vaclav_24-Oct-14 8:19
Vaclav_24-Oct-14 8:19 
AnswerRe: Cannot initialize array of classes except as a local variable. Pin
Chris Losinger24-Oct-14 9:09
professionalChris Losinger24-Oct-14 9:09 
GeneralRe: Cannot initialize array of classes except as a local variable. Pin
Vaclav_24-Oct-14 9:19
Vaclav_24-Oct-14 9:19 
QuestionRe: Cannot initialize array of classes except as a local variable. Pin
David Crow24-Oct-14 10:50
David Crow24-Oct-14 10:50 
AnswerRe: Cannot initialize array of classes except as a local variable. Pin
Vaclav_24-Oct-14 15:04
Vaclav_24-Oct-14 15:04 
AnswerRe: Cannot initialize array of classes except as a local variable. Pin
Stefan_Lang27-Oct-14 4:02
Stefan_Lang27-Oct-14 4:02 
QuestionRecursive function - how to correctly implement return? Pin
Vaclav_22-Oct-14 9:20
Vaclav_22-Oct-14 9:20 
AnswerRe: Recursive function - how to correctly implement return? Pin
Richard Andrew x6422-Oct-14 10:06
professionalRichard Andrew x6422-Oct-14 10:06 
SuggestionRe: Recursive function - how to correctly implement return? Pin
«_Superman_»22-Oct-14 18:56
professional«_Superman_»22-Oct-14 18:56 
GeneralRe: Recursive function - how to correctly implement return? Pin
Vaclav_23-Oct-14 5:57
Vaclav_23-Oct-14 5:57 
AnswerRe: Recursive function - how to correctly implement return? Pin
Stefan_Lang23-Oct-14 1:57
Stefan_Lang23-Oct-14 1:57 
1. It is always possible to make do with a single return. I'm not sure what makes you think otherwise.

2. searching an array for a matching value is a trivial operation - why did you implement it recursively? What is so difficult in your search algorithm that it prevents you from implementing it in a simple loop?

3. having a static counter for depth of recursion is a common method, and it helps catching endless recursions. But, generally speaking, static variables can cause many issues - if there is even a remote chance you're going to use multithreading sometime in the future, just forget about it! Either way, a safer method is to create a context and pass a reference (i. e. pointer in C/C++) to the recursive function. That context object may contain a counter or any other mechanism to control recursion depth, but it won't be static: it lives in the context of the thread that initialiy called the recursive function, and it won't cause conflicts when that function is called from different clients at the same time.
GOTOs are a bit like wire coat hangers: they tend to breed in the darkness, such that where there once were few, eventually there are many, and the program's architecture collapses beneath them. (Fran Poretto)

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.