I was wondering if anyone could help me with this, so I have asimple text file t
ID: 3610752 • Letter: I
Question
I was wondering if anyone could help me with this, so I have asimple text file that would contain something like this:UID PID PPID TTY STIME COMMAND
Ben 1760 1 con 17:30:02 /usr/bin/bash
Ben 1676 1760 con 17:31:07 /usr/bin/ps
and I need to load this into a 2dimensional array so that I canlater look through the array and see how many UID's there are andhow many processes each one is running, the only problem is Ihonestly have no idea on how to do that, can anyone help me withthis, I've always had a problem with using file.
It can be done in either c or c++ w/e works best for you, andvectors or arrays will do fine but preferably arrays.
Explanation / Answer
please rate - thanks #include #include #include using namespace std; int main(){ string data[50][6],header; int i,j,count=0; ifstream input; input.open("input.txt"); //open file if(input.fail()) //is it ok? { coutdata[count][0]; while(input) { for(i=1;i>data[count][i]; count++; input>>data[count][0]; } coutRelated Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.