Click here to Skip to main content
15,914,396 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Help saving large formatted text to database Pin
David Salter13-Feb-03 11:54
David Salter13-Feb-03 11:54 
GeneralRe: Help saving large formatted text to database Pin
Anonymous13-Feb-03 12:21
Anonymous13-Feb-03 12:21 
GeneralHELP! C++ Assignement Operator Problem Pin
Anton A. Loukine13-Feb-03 11:05
Anton A. Loukine13-Feb-03 11:05 
GeneralRe: HELP! C++ Assignement Operator Problem Pin
Joaquín M López Muñoz13-Feb-03 11:22
Joaquín M López Muñoz13-Feb-03 11:22 
GeneralRe: HELP! C++ Assignement Operator Problem Pin
Anton A. Loukine13-Feb-03 11:33
Anton A. Loukine13-Feb-03 11:33 
GeneralRe: HELP! C++ Assignement Operator Problem Pin
Roger Allen13-Feb-03 22:50
Roger Allen13-Feb-03 22:50 
GeneralRe: HELP! C++ Assignement Operator Problem Pin
João Paulo Figueira13-Feb-03 11:57
professionalJoão Paulo Figueira13-Feb-03 11:57 
GeneralHelp!!..with List container Pin
Sal R.13-Feb-03 10:55
Sal R.13-Feb-03 10:55 
Confused | :confused: Can any body help me figure out whats wrong with this code? All i'm trying to do is make a list of structs and then having the data in the lists printed. I havn't coded in C++ in a while so i'm assuming its the syntax


#include <fstream>
#include <iostream>
#include <iomanip> // format manipulation
#include <list> // list class library


using namespace std;



struct server
{
int server_ID;
int server_speed;
int operator==(const server&);
server& operator=(const server&);
}



int main()
{

ifstream myFile ("Request.dat", ios::in); // Don't mind this two lines
int Reqid, Artime, Cputime, server_num;


cout << "How many servers ur bitch ass wants?\n"; //Asking the user how many servers the list will consist of
cin >> server_num;


server IBM; // declare and instance of my struct

for (int i=0; i >= server_num; i++) // for each server the user requests
{ // an ID and server speed will be placed in the list
IBM.server_ID = i; // accessing the data member "ID"
IBM.server_speed = rand()% 700+100; // generating a random number for the server speed

list<server> servers;

servers.push_back (server_ID); // inputting data into list
servers.push_back (server_speed);
while (!servers.empty())
{
cout << servers.front() << " "; //printing the contents of my list
servers.pop_front();
}


cout << "\n";

/*while (!myFile.eof())
{
myFile >> Reqid >> Artime >> Cputime;

list<int> list1;

list1.push_back (Reqid);
list1.push_back (Artime);
list1.push_back (Cputime);
while (!list1.empty())
{
cout << list1.front() << ' ';
list1.pop_front();
}
*/

// Output the list values, by repeatedly getting the item from
// the "front" of the list, outputting it, and removing it
// from the front of the list.




}
return 0;
}

Sal. R
GeneralRe: Help!!..with List container Pin
Christian Graus13-Feb-03 11:15
protectorChristian Graus13-Feb-03 11:15 
GeneralRunning a program at startup ! Pin
Hadi Rezaee13-Feb-03 10:06
Hadi Rezaee13-Feb-03 10:06 
GeneralRe: Running a program at startup ! Pin
Navin13-Feb-03 10:27
Navin13-Feb-03 10:27 
GeneralRe: Running a program at startup ! Pin
Hadi Rezaee13-Feb-03 10:34
Hadi Rezaee13-Feb-03 10:34 
GeneralRe: Running a program at startup ! Pin
Scorp1us13-Feb-03 10:27
Scorp1us13-Feb-03 10:27 
GeneralRe: Running a program at startup ! Pin
Hadi Rezaee13-Feb-03 10:35
Hadi Rezaee13-Feb-03 10:35 
GeneralRe: Running a program at startup ! Pin
Anonymous13-Feb-03 16:55
Anonymous13-Feb-03 16:55 
GeneralRe: Running a program at startup ! Pin
Hadi Rezaee13-Feb-03 19:52
Hadi Rezaee13-Feb-03 19:52 
GeneralRe: Running a program at startup ! Pin
palbano13-Feb-03 10:44
palbano13-Feb-03 10:44 
GeneralRe: Running a program at startup ! Pin
Christian Graus13-Feb-03 10:54
protectorChristian Graus13-Feb-03 10:54 
GeneralRe: Running a program at startup ! Pin
Hadi Rezaee13-Feb-03 11:04
Hadi Rezaee13-Feb-03 11:04 
QuestionCan CBitmapButton load bitmap from disk ? Pin
akulkarni13-Feb-03 8:58
akulkarni13-Feb-03 8:58 
GeneralCD burning. Pin
Tili13-Feb-03 8:09
Tili13-Feb-03 8:09 
GeneralRe: CD burning. Pin
Rickard Andersson2013-Feb-03 8:23
Rickard Andersson2013-Feb-03 8:23 
GeneralRe: CD burning. Pin
Mike Nordell13-Feb-03 13:13
Mike Nordell13-Feb-03 13:13 
GeneralStreamIn to RichEdit Control causes Illegal Instruction Error Pin
ElizabethC13-Feb-03 7:37
ElizabethC13-Feb-03 7:37 
GeneralClassWizard is screwing up, and I can't fix Pin
Scorp1us13-Feb-03 7:36
Scorp1us13-Feb-03 7:36 

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.