If you want to implement your function before the

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: colon at the end) will “declare” your function. It will tell the main function that the push function exists and what its input parameters are and what its return type is. The function itself can be “implemented” after the main function as well. “Implementation” is writing the entire procedure of the function within the curly braces. This helps people who are mainly interested in just following the high- level procedure of your main function, and skip reading through the inner workings of other functions. For example: #include <iostream> using namespace std; /* This is the declaration. implemented before the main other file, the declaration the main function that such void printNumber(int n); If the function is function, or is in must be present to a function exists. not some tell */ int main() { printNumber(4); printNumber(1...
View Full Document

This lab report was uploaded on 03/02/2014 for the course CS 200 taught by Professor Fareedzaffar during the Winter '11 term at Lahore University of Management Sciences.

Ask a homework question - tutors are online