function prototype with header files 9_1

// ConsoleApplication3.cpp : Defines the entry point for the console application.

//chapter nine programming challenge 1

//date 10/08/2014

//#include "stdafx.h"

#include <iostream>

using namespace std;

/*

int _tmain(int argc, _TCHAR* argv[])

{

return 0;

}

*/

//function prototype for functions defined after main function

int * arrayAllocator(int);

int main(){

int *aryptr=arrayAllocator(10);

cout<< aryptr[0] << endl;

}

int * arrayAllocator(int num){

int * numptr;

numptr = new int[num];

numptr[0] = 55;

return numptr;

}

Popular posts from this blog

ch11 review silberschatz operating systems concepts essentials 2nd ed