Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include "stdafx.h"
- #include <iostream>
- #include <string>
- using namespace std;
- double* ReadData(int& size)
- {
- double* arrPoint = new double[10];
- int count = 0;
- int input;
- char again;
- while (cin >> input)
- {
- if (cin.fail())
- {
- break;
- }
- arrPoint[count] = input;
- size++;
- count++;
- }
- return arrPoint;
- }
- int main()
- {
- double* pointer;
- int size = 0;
- cout << "Please enter the contents for the array (Enter 'q' to quit): ";
- pointer = ReadData(size);
- cout << endl;
- for (int i = 0; i < size; i++)
- {
- cout << pointer[i] << " ";
- }
- cout << endl;
- cout << size;
- system("pause");
- return 0;
- }
Add Comment
Please, Sign In to add comment