Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //#define _GNU_SOURCE
- #include<iostream>
- #include <stdio.h>
- #include <stdlib.h>
- #include <pthread.h>
- #include <string.h>
- #include <vector>
- using namespace std;
- int main(int argc, char **argv)
- {
- int iDeviceNum=0;
- string sDeviceName;
- int iDeviceOutput=0;
- vector<float>vDeviceOutputs; // expressed in terms of outputs
- vector<string> DeviceNames;
- cout << "Enter a number for the amount of devices your person has" << endl;
- cin >> iDeviceNum;
- cout << "The amount of devices are: " << iDeviceNum << endl;
- cout<<"Enter the device Names here" << endl;
- /*for(int i=0;i<iDeviceNum;i++)
- {
- cin>>sDeviceName;
- DeviceNames.push_back(sDeviceName);
- }*/
- int i=iDeviceNum;
- //while((cin>>sDeviceName) && (i>0)) // this conditional not correct b.c you don't accept input first time
- // around
- while(i>0)
- {
- cin>>sDeviceName;
- DeviceNames.push_back(sDeviceName);
- cout << "The value of i before dec is: " << i << endl;
- i--;
- cout << "The value of i after dec is: " << i << endl;
- }
- cout << "The actual device vector" << endl;
- for(unsigned int i=0;i<DeviceNames.size();i++)
- {
- cout<<"The device name at " <<i<<"is: "<<DeviceNames[i]<<endl;
- }
- cout << "Enter the device outputs here: "<< endl;
- int j=iDeviceNum;
- while(j>0)
- {
- cin>>iDeviceOutput;
- vDeviceOutputs.push_back(iDeviceOutput);
- j--;
- }
- //for(unsigned int i=0;i<vDeviceOutputs.size();i++)
- //{
- //cout<<"The device outputs at "<<i<< " are " <<vDeviceOutputs[i]<<endl;
- //}
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement