View Single Post
Old 10-24-2004, 09:33 PM   #1 (permalink)
somnath
Registered User
 
Join Date: Oct 2004
Posts: 4
somnath is on a distinguished road
help with program

Write a complete program that creates an array of characters, 3 times
the size of ASCII table and itinializes the contents of the array to
correcponding ACSII values; when end of ACSII table is reached, you
should loop back to the beggining and start again.

Print the contents of the array, seporating the copies of ACSII table by
2 blank lines.


Note:
- You must utilize for loop structure.
- You may not combine assigment and printing out in one phaze, those
two must be seporate distinct stages.


Tips:
- use % as part of your for-loops to help you loop through the legal
range of an ACSII table



and here i came up with....dont know what to do next

#include <iostream>
using namespace std;
using std::endl;
int main (void)
{

cout<<"ASCII Table"endl;
int i;
char array = 256*3;
int arr [array];

for(int i=0; i<(array); i++)
arr[i] = i%256;
}
OUTPUT should be like this...
!@#$%... 12345... abcdefgh... ABCDBEFGH...

!@#$%... 12345... abcdefgh... ABCDBEFGH...

!@#$%... 12345... abcdefgh... ABCDBEFGH...

Help would greatly appreciated!
somnath is offline   Reply With Quote