Start New Discussion within our Software Development Community

hello guys ! i have created a program just to understand how to return a value from using a recursive program

what it does it thati have have two variable i.e first and last
the value of first is zero and last is 10

not i want the function to continue until last ==to first
if not it would simply return the value of the last and decrement here is the code and the prob listed and yes i am noob

#include "stdafx.h"
#include <iostream>
# define size 10;
int mergesort(int,int);
using namespace std;

int _tmain(int argc, _TCHAR* argv[])
    int first=0,last=10;

    //cout <<" enter the vlaues";

    //for(int i=0;i<10;i++)
    return 0;

int mergesort(int first,int last,int mid)
{ int a=34343434;
   cout<<"mergesort called";
                cout<<"its the end of the world";

                return a;


 return last;
return first;

here is the prob and plz tell me how to over come it

1>------ Build started: Project: merge sort, Configuration: Debug Win32 ------
1>merge sort.obj : error LNK2019: unresolved external symbol "int __cdecl mergesort(int,int)" (?mergesort@@YAHHH@Z) referenced in function _wmain
1>C:\Documents and Settings\muqeet\My Documents\Visual Studio 2005\Projects\merge sort\Debug\merge sort.exe : fatal error LNK1120: 1 unresolved externals
1>Build log was saved at "file://c:\Documents and Settings\muqeet\My Documents\Visual Studio 2005\Projects\merge sort\merge sort\Debug\BuildLog.htm"
1>merge sort - 2 error(s), 0 warning(s)
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

i created this program in visual c++ 2005

this is not merge sort i was just testing a theory of mine or rather trying to understand it through experiment .
All this programdoes it that it recursivly displays counting in desending form that its

This question has already been answered. Start a new discussion instead.