header files are complicated

pointer types are important

prototypes must be defined for functions built after the main function


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

//chapter nine programming challenge 1

//date 10/08/2014
 
 

#include <iostream>

using namespace std;




//function prototype for functions defined after main function
 
 
int * arrayAllocator(int);

int main(){

int *aryptr=arrayAllocator(10);



cout<< aryptr[0] << endl;
 
int fred;



cin >> fred;

}
 
int * arrayAllocator(int num){

int * numptr;

numptr = new int[num];



numptr[0] = 55;
 
return numptr;



}

Popular posts from this blog

a+ cert test prep