buffer.cppassn1 - for int v = 0 v<(BUFFER_COLUMNS 2 v...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
//include header file #include "buffer.h" //function definitions void bufferClear(Buffer b) { for ( int i=0; i < BUFFER_ROWS; i++) { for ( int j = 0; j < BUFFER_COLUMNS; j++) { b[i][j] = BUFFER_EMPTY; } } return ; } void bufferPrint(Buffer b) { for ( int s = 0; s < (BUFFER_COLUMNS + 2) ; s++) { cout << BUFFER_BORDER ; } cout << endl ; for ( int t = 0; t < BUFFER_ROWS ; t++) { cout << BUFFER_BORDER; for ( int u = 0; u < BUFFER_COLUMNS ; u++) { cout << b[t][u]; } cout << BUFFER_BORDER << endl;
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Background image of page 2
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: } for ( int v = 0; v < (BUFFER_COLUMNS + 2) ; v++) { cout << BUFFER_BORDER ; } cout<<endl; return ; } void bufferSetCell(Buffer b, char myChar, int myRow, int myCol ) { if (myRow > BUFFER_ROWS || myRow > BUFFER_COLUMNS ) { cout << "The row and column entered are invalid, Please try agian!" <<endl; } else { b[myRow][myCol] = myChar; } return ; }...
View Full Document

This note was uploaded on 09/29/2011 for the course BUSINESS 111 taught by Professor Fredjames during the Spring '11 term at Abu Dhabi University.

Page1 / 2

buffer.cppassn1 - for int v = 0 v<(BUFFER_COLUMNS 2 v...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online