Click here to Skip to main content
15,911,141 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: Can i trust the result of clock_getres? Pin
Stefan_Lang12-Sep-14 1:50
Stefan_Lang12-Sep-14 1:50 
AnswerRe: Can i trust the result of clock_getres? Pin
CPallini12-Sep-14 2:49
mveCPallini12-Sep-14 2:49 
Questionwhat is C language ? Pin
uetester111-Sep-14 22:01
uetester111-Sep-14 22:01 
AnswerRe: what is C language ? Pin
CPallini11-Sep-14 22:10
mveCPallini11-Sep-14 22:10 
GeneralRe: what is C language ? Pin
Albert Holguin16-Sep-14 8:31
professionalAlbert Holguin16-Sep-14 8:31 
QuestionInitializing structure with pointers to char arrays - bug Pin
Vaclav_11-Sep-14 4:59
Vaclav_11-Sep-14 4:59 
QuestionRe: Initializing structure with pointers to char arrays - bug Pin
CPallini11-Sep-14 5:09
mveCPallini11-Sep-14 5:09 
AnswerRe: Initializing structure with pointers to char arrays - bug Pin
Vaclav_11-Sep-14 6:30
Vaclav_11-Sep-14 6:30 
AnswerRe: Initializing structure with pointers to char arrays - bug Pin
ahmad_ali11-Sep-14 5:10
ahmad_ali11-Sep-14 5:10 
GeneralRe: Initializing structure with pointers to char arrays - bug Pin
Vaclav_11-Sep-14 6:44
Vaclav_11-Sep-14 6:44 
GeneralRe: Initializing structure with pointers to char arrays - bug Pin
Vaclav_11-Sep-14 6:47
Vaclav_11-Sep-14 6:47 
GeneralSOLVED Re: Initializing structure with pointers to char arrays - bug Pin
Vaclav_11-Sep-14 7:14
Vaclav_11-Sep-14 7:14 
QuestionCalling a web service from Visual C++ 2008 native Pin
Hadi Dayvary11-Sep-14 3:09
professionalHadi Dayvary11-Sep-14 3:09 
QuestionExecute Shell Script and Batch Files Pin
AmbiguousName10-Sep-14 23:37
AmbiguousName10-Sep-14 23:37 
AnswerRe: Execute Shell Script and Batch Files Pin
Richard MacCutchan10-Sep-14 23:47
mveRichard MacCutchan10-Sep-14 23:47 
GeneralRe: Execute Shell Script and Batch Files Pin
AmbiguousName11-Sep-14 0:23
AmbiguousName11-Sep-14 0:23 
GeneralRe: Execute Shell Script and Batch Files Pin
Richard MacCutchan11-Sep-14 0:31
mveRichard MacCutchan11-Sep-14 0:31 
GeneralRe: Execute Shell Script and Batch Files Pin
AmbiguousName11-Sep-14 0:49
AmbiguousName11-Sep-14 0:49 
GeneralRe: Execute Shell Script and Batch Files Pin
Richard MacCutchan11-Sep-14 1:20
mveRichard MacCutchan11-Sep-14 1:20 
Questiondeterminant of matrix in c N*N dimension return process kill .I took from net can anyone help me out where exactly its making this issue and how to overcome this issue.As per my program i pass @dimensional matrix of order x=100; Pin
mybm110-Sep-14 20:06
mybm110-Sep-14 20:06 
AnswerRe: determinant of matrix in c N*N dimension return process kill .I took from net can anyone help me out where exactly its making this issue and how to overcome this issue.As per my program i pass @dimensional matrix of order x=100; Pin
Stefan_Lang11-Sep-14 2:51
Stefan_Lang11-Sep-14 2:51 
GeneralRe: determinant of matrix in c N*N dimension return process kill .I took from net can anyone help me out where exactly its making this issue and how to overcome this issue.As per my program i pass @dimensional matrix of order x=100; Pin
mybm111-Sep-14 2:55
mybm111-Sep-14 2:55 
GeneralRe: determinant of matrix in c N*N dimension return process kill .I took from net can anyone help me out where exactly its making this issue and how to overcome this issue.As per my program i pass @dimensional matrix of order x=100; Pin
Stefan_Lang11-Sep-14 4:40
Stefan_Lang11-Sep-14 4:40 
What I meant is, check programatically the depth of your recursion. E. g. define a static counter within your recursive function, and always compare it to the maximum allowed value, like this:

C++
const int max_recursion_level = 20;
int foo(int n) {
   int result = 0;
   // define static recursion counter
   static int recursion_level = 0;
   // increment at the start of the function, before the first recursive call
   ++recursion_level;
   // safety check
   if (recursion_level > max_recursion_level)
      throw("recursion level exceeded!");

   if (n<=0)
      result = 0;
   else if (n==1)
      result = 1;
   else
      result = foo(n-1) + foo(n-2);

   // decrement counter at the end of the function, after the last recursive call
   --recursion_level;

   return result;
}


As for calculating the determinant without recursion, I am sure there are plenty of algorithms on the web if you search for it. I?ve found one in the first response to this question: http://cboard.cprogramming.com/cplusplus-programming/30001-determinant-calculation.html[^]
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)

GeneralRe: determinant of matrix in c N*N dimension return process kill .I took from net can anyone help me out where exactly its making this issue and how to overcome this issue.As per my program i pass @dimensional matrix of order x=100; Pin
mybm111-Sep-14 19:34
mybm111-Sep-14 19:34 
GeneralRe: determinant of matrix in c N*N dimension return process kill .I took from net can anyone help me out where exactly its making this issue and how to overcome this issue.As per my program i pass @dimensional matrix of order x=100; Pin
Stefan_Lang11-Sep-14 20:06
Stefan_Lang11-Sep-14 20:06 

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.