Advertisement
Advertisement
| 05.03.2008 at 10:52PM PDT, ID: 23374578 |
|
[x]
Attachment Details
|
||
1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20: 21: 22: 23: 24: 25: 26: 27: 28: 29: 30: |
#include <iostream>
using namespace std;
int main()
{
//array of char pointers
char *fruit[3];
for ( int i = 0; i < 3; i++)
fruit[i] = new char[30];
char *start, *end;
for (start = fruit, end = &fruit[2]; start <= end; start++)
{
cin >> start;
}
cout << endl;
for (start = fruit, end = &fruit[2]; start <= end; start++)
{
cout << start << endl;
}
for ( int i = 0; i < 3; i++)
delete [] fruit[i];
system("PAUSE");
return 0;
}
|