So Im hoping Im posting in the right section and everything but I figured since I need to learn c++ to code hacks I could get some help here with a fairly simple program....
Im using vs 2008 and I have no problem compiling this program however I do have a problem during runtime the program wont always throw an error when allocating memory sometimes it just freezes but I have no clue why.... Any help is appreciated

thanks in advance i iz dumb
my code:
//Start of code
//
//Start define
#include "stdafx.h"
#include <iostream>
#include <sstream>
#include <string>
#include <new>
using namespace std;
//End define
//
//Start functions used in main
//
//Makelist function begin
int* makelist (int a)
{
cout << "Initializing memory for operation, please wait...\n";
int * lenghth;
lenghth = new (nothrow) int [a];
if (lenghth == 0)
{
cout << "ERROR ALLOCATING MEMORY!\n";
return 0;
}
cout << "Done!\n";
return(lenghth);
}
//Makelist function end
//
//Pause function begin
void pause ()
{
cin.ignore();
cin.get();
}
//Pause function end
//
//Start function clearmem
void clearmem (int * addy, int lenghth)
{
cout << "Freeing memory please wait...\n";
delete[lenghth] addy;
cout << "Done!\n";
}
//End function clearmem
//
//End functions used in main
//
//Start main
int main()
{
int a;
int a_const;
int * list_location;
cout << "Enter the number of numbers you want to find in the Fibonaci sequence.\n";
cin >> a;
a_const = a;
if (a == 0)
{
cout << "Ummmm so you started this program to not use it.... im not going\nto calculate the 0th number -.-\npress enter to close...";
pause();
return 0;
}
list_location = makelist (a);
clearmem(list_location, a_const);
pause();
return 0;
}
//End main
//
//End code
EDIT: The last thing shown in console is "Initializing memory for operation, please wait..." then it usually freezes the strange thing is up to 999999999 it just fails to initialise and throws the error message up but when there are 10 digits then it freezes.... I dont know of any explanation for this.... help please :/