Click here to Skip to main content
15,906,947 members
Home / Discussions / C#
   

C#

 
AnswerRe: EF 6 and C# applications (Web & Windows) Pin
Gerry Schmitz1-Aug-16 5:21
mveGerry Schmitz1-Aug-16 5:21 
AnswerRe: EF 6 and C# applications (Web & Windows) Pin
Mycroft Holmes1-Aug-16 13:01
professionalMycroft Holmes1-Aug-16 13:01 
QuestionHow To Create Math Parser? Pin
Daniyaltjm31-Jul-16 2:12
Daniyaltjm31-Jul-16 2:12 
AnswerRe: How To Create Math Parser? Pin
OriginalGriff31-Jul-16 2:29
mveOriginalGriff31-Jul-16 2:29 
GeneralRe: How To Create Math Parser? Pin
Daniyaltjm31-Jul-16 4:07
Daniyaltjm31-Jul-16 4:07 
GeneralRe: How To Create Math Parser? Pin
OriginalGriff31-Jul-16 4:19
mveOriginalGriff31-Jul-16 4:19 
Questionneed help witch creating method Pin
Member 1138393529-Jul-16 23:55
Member 1138393529-Jul-16 23:55 
AnswerRe: need help witch creating method Pin
OriginalGriff30-Jul-16 0:11
mveOriginalGriff30-Jul-16 0:11 
Well, yes...
C#
public static int Sum(int start, int end)
{
    if (start >= end)
    {
        return  0;
    }
    // TODO add your code here
    else
    {
        return Sum(start, end);
    }
}

If you call Sum with start less than end:
C#
Sum(1, 2);
Then it will look at the two values, and see which is the greater.
It's end, so the if test will fail, and it will execute the else clause ... which passes the same values to the Sum method so it does teh same thing again, and again, until it runs out of stack space and fails!
Probably, what you meant to do was
C#
return start + Sum(start + 1, end);
But to be honest, a recursive method to do this is a bit overkill! Laugh | :laugh:
Why not try it with a simple for loop?
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...

QuestionParsing a string with multiple values - JSON or Retro? Pin
Michael Breeden29-Jul-16 1:48
Michael Breeden29-Jul-16 1:48 
AnswerRe: Parsing a string with multiple values - JSON or Retro? Pin
Richard Deeming29-Jul-16 2:09
mveRichard Deeming29-Jul-16 2:09 
GeneralRe: Parsing a string with multiple values - JSON or Retro? Pin
Michael Breeden29-Jul-16 2:43
Michael Breeden29-Jul-16 2:43 
GeneralRe: Parsing a string with multiple values - JSON or Retro? Pin
Richard Deeming29-Jul-16 2:47
mveRichard Deeming29-Jul-16 2:47 
GeneralRe: Parsing a string with multiple values - JSON or Retro? Pin
Michael Breeden29-Jul-16 3:18
Michael Breeden29-Jul-16 3:18 
GeneralRe: Parsing a string with multiple values - JSON or Retro? Pin
Richard Deeming29-Jul-16 3:36
mveRichard Deeming29-Jul-16 3:36 
GeneralRe: Parsing a string with multiple values - JSON or Retro? Pin
Michael Breeden29-Jul-16 4:02
Michael Breeden29-Jul-16 4:02 
Questionconvert Ms access project to c# Pin
dabbourabd28-Jul-16 23:00
dabbourabd28-Jul-16 23:00 
AnswerRe: convert Ms access project to c# Pin
Richard MacCutchan28-Jul-16 23:08
mveRichard MacCutchan28-Jul-16 23:08 
AnswerRe: convert Ms access project to c# Pin
OriginalGriff28-Jul-16 23:09
mveOriginalGriff28-Jul-16 23:09 
GeneralRe: convert Ms access project to c# Pin
dabbourabd28-Jul-16 23:37
dabbourabd28-Jul-16 23:37 
GeneralRe: convert Ms access project to c# Pin
dabbourabd28-Jul-16 23:32
dabbourabd28-Jul-16 23:32 
AnswerRe: convert Ms access project to c# Pin
BillWoodruff29-Jul-16 3:16
professionalBillWoodruff29-Jul-16 3:16 
GeneralRe: convert Ms access project to c# Pin
dabbourabd29-Jul-16 11:00
dabbourabd29-Jul-16 11:00 
AnswerRe: convert Ms access project to c# Pin
Eddy Vluggen29-Jul-16 4:39
professionalEddy Vluggen29-Jul-16 4:39 
GeneralRe: convert Ms access project to c# Pin
dabbourabd29-Jul-16 10:58
dabbourabd29-Jul-16 10:58 
GeneralRe: convert Ms access project to c# Pin
Eddy Vluggen29-Jul-16 14:26
professionalEddy Vluggen29-Jul-16 14: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.