Click here to Skip to main content
15,894,291 members
Home / Discussions / ATL / WTL / STL
   

ATL / WTL / STL

 
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 
AnswerRe: how can I use control ?which book I shoud see? Pin
Michael Dunn4-Apr-06 11:46
sitebuilderMichael Dunn4-Apr-06 11:46 
GeneralRe: how can I use control ?which book I shoud see? Pin
heboy4-Apr-06 15:45
heboy4-Apr-06 15:45 
QuestionHow can i sort the elements of the CListCtrl by clicking the Column Heading Pin
Jitendra Shri3-Apr-06 17:24
Jitendra Shri3-Apr-06 17:24 
AnswerRe: How can i sort the elements of the CListCtrl by clicking the Column Heading Pin
Igor Vigdorchik4-Apr-06 7:24
Igor Vigdorchik4-Apr-06 7:24 
QuestionBase64Encode Pin
gyzmau3-Apr-06 4:04
gyzmau3-Apr-06 4:04 
AnswerRe: Base64Encode Pin
SilentSilent5-Apr-06 0:16
SilentSilent5-Apr-06 0:16 
QuestionHow can i sort list in the ATL application Pin
Jitendra Shri31-Mar-06 3:09
Jitendra Shri31-Mar-06 3:09 
AnswerRe: How can i sort list in the ATL application Pin
Milton Karimbekallil1-Apr-06 3:01
Milton Karimbekallil1-Apr-06 3:01 
AnswerRe: How can i sort list in the ATL application Pin
Igor Vigdorchik2-Apr-06 10:26
Igor Vigdorchik2-Apr-06 10:26 
Questionhow to declare a method with out parameter Pin
baldha rakesh30-Mar-06 23:26
baldha rakesh30-Mar-06 23:26 
AnswerRe: how to declare a method with out parameter Pin
Stephen Hewitt30-Mar-06 23:39
Stephen Hewitt30-Mar-06 23:39 
GeneralRe: how to declare a method with out parameter Pin
baldha rakesh31-Mar-06 1:58
baldha rakesh31-Mar-06 1:58 

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.