Click here to Skip to main content
15,916,091 members
Home / Discussions / ATL / WTL / STL
   

ATL / WTL / STL

 
GeneralRe: The corrected version ;) Pin
Nemanja Trifunovic13-Apr-06 3:11
Nemanja Trifunovic13-Apr-06 3:11 
GeneralRe: The corrected version ;) Pin
alabax13-Apr-06 5:24
alabax13-Apr-06 5:24 
GeneralRe: The corrected version ;) Pin
Johann Gerell25-Apr-06 20:58
Johann Gerell25-Apr-06 20:58 
Questionhow to access messages that have been arrived from msmq Pin
kiran janaswamy12-Apr-06 1:44
kiran janaswamy12-Apr-06 1:44 
AnswerRe: how to access messages that have been arrived from msmq Pin
David Crow13-Apr-06 2:49
David Crow13-Apr-06 2:49 
Questionhave to access one interface methods in another interface methods. Pin
kiran janaswamy11-Apr-06 20:10
kiran janaswamy11-Apr-06 20:10 
AnswerRe: have to access one interface methods in another interface methods. Pin
Stephen Hewitt12-Apr-06 0:53
Stephen Hewitt12-Apr-06 0:53 
QuestionWhere to start. Pin
Polity4h11-Apr-06 11:24
Polity4h11-Apr-06 11:24 
QuestionHow cam I set background color of tab control Pin
SheruVishal11-Apr-06 4:30
SheruVishal11-Apr-06 4:30 
QuestionAccess Remote Folders Pin
kiran janaswamy11-Apr-06 1:36
kiran janaswamy11-Apr-06 1:36 
AnswerRe: Access Remote Folders Pin
Milton Karimbekallil11-Apr-06 11:31
Milton Karimbekallil11-Apr-06 11:31 
QuestionHow to access global functions and global variables in ATL Component. Pin
kiran janaswamy11-Apr-06 1:25
kiran janaswamy11-Apr-06 1:25 
AnswerRe: How to access global functions and global variables in ATL Component. Pin
Milton Karimbekallil11-Apr-06 11:07
Milton Karimbekallil11-Apr-06 11:07 
GeneralRe: How to access global functions and global variables in ATL Component. Pin
kiran janaswamy11-Apr-06 20:05
kiran janaswamy11-Apr-06 20:05 
GeneralRe: How to access global functions and global variables in ATL Component. Pin
kiran janaswamy12-Apr-06 1:03
kiran janaswamy12-Apr-06 1:03 
QuestionMFC ActiveX Pin
Subramaniam s.V.10-Apr-06 0:12
Subramaniam s.V.10-Apr-06 0:12 
AnswerRe: MFC ActiveX Pin
Milton Karimbekallil11-Apr-06 11:11
Milton Karimbekallil11-Apr-06 11:11 
Questionwhy can not get the variable value correctly Pin
brygid9-Apr-06 20:24
brygid9-Apr-06 20:24 
AnswerRe: why can not get the variable value correctly Pin
Milton Karimbekallil11-Apr-06 11:18
Milton Karimbekallil11-Apr-06 11:18 
QuestionAccessing members of objects stored in container. Pin
gc3isr8-Apr-06 19:59
gc3isr8-Apr-06 19:59 
I am using the STL list container to hold objects of class a. Class a has various member variables of standard type(int, char, etc.). All variables are public. How would I go about accessing those variables in order to compare one object to another?

This is some of my actual code.


void ProcessFile(string filename, std::queue<cjob> &jobQueue)
{
char jobID = 'Z';
int numJobs;
int priority;
int arrivaltime;
int cpuburst[2];
int ioburst[2];



int i;

// ofstream constructor opens file
ifstream injobFile( filename.c_str(), ios::in );
ifstream injobFile1( filename.c_str(), ios::in );
// exit program if unable to create file
if ( !injobFile )
{ // overloaded ! operator
cerr << "File could not be opened" << endl;
exit( 1 );
} // end if

cout << "Reading file..." << endl;

/* //Count number of jobs by counting occurrences of \n
numJobs = static_cast<int>( std::count( std::istreambuf_iterator<char>(injobFile1),
std::istreambuf_iterator<char>(), '\n' ) );
*/

char crap = '(';

//input from file;
i = 0;
//Job * ptrarr_Jobs[10];



while ( i < numJobs)
{
injobFile >> crap >> jobID >> priority >> arrivaltime >> cpuburst[0] >> ioburst[0] >> cpuburst[1] >> ioburst[1] >> crap;

CJob tempJob(jobID, priority, arrivaltime, cpuburst[0], ioburst[0], cpuburst[1], ioburst[1] );
//tempJob = new CJob(jobID, priority, arrivaltime, cpuburst[0], ioburst[0], cpuburst[1], ioburst[1] );

jobQueue.push(tempJob);

cout << "(" << jobID << ' ' << priority << ' ' << arrivaltime
<< ' ' << cpuburst[0] << ' ' << ioburst[0]
<< ' ' << cpuburst[1] << ' ' << ioburst[1]
<< ")" << endl;

i++;

} // end while


return ; // ofstream destructor closes file
} // end ProcessFile()

Notice I referenced the queue; I am having trouble accessing the CJob objects' member variables when I am in the calling function...(main() in this case).



Thanks for any help.
QuestionCAxWindow Pin
Anthony98875-Apr-06 9:07
Anthony98875-Apr-06 9:07 
AnswerRe: CAxWindow Pin
Michael Dunn5-Apr-06 13:36
sitebuilderMichael Dunn5-Apr-06 13:36 
GeneralRe: CAxWindow Pin
Anthony98876-Apr-06 4:44
Anthony98876-Apr-06 4:44 
GeneralRe: CAxWindow Pin
Stuart Dootson7-Apr-06 23:06
professionalStuart Dootson7-Apr-06 23:06 
Questionhow can I use control ?which book I shoud see? Pin
heboy3-Apr-06 17:37
heboy3-Apr-06 17:37 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.