Click here to Skip to main content
16,006,382 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionHow to get application currently activated Pin
Ales Petric25-Apr-05 22:08
professionalAles Petric25-Apr-05 22:08 
AnswerRe: How to get application currently activated Pin
ThatsAlok25-Apr-05 22:50
ThatsAlok25-Apr-05 22:50 
AnswerRe: How to get application currently activated Pin
stolid_rock26-Apr-05 0:06
stolid_rock26-Apr-05 0:06 
GeneralRe: How to get application currently activated Pin
Ales Petric26-Apr-05 3:48
professionalAles Petric26-Apr-05 3:48 
GeneralNeed help about Office Automation Pin
figer25-Apr-05 21:54
figer25-Apr-05 21:54 
GeneralRe: Need help about Office Automation Pin
V.25-Apr-05 23:30
professionalV.25-Apr-05 23:30 
GeneralRe: Need help about Office Automation Pin
Jason Henderson26-Apr-05 3:12
Jason Henderson26-Apr-05 3:12 
QuestionCan Sombody help ??? Pin
khyap25-Apr-05 21:46
khyap25-Apr-05 21:46 
Can somebody help me to modify the following program ??

#include iostream
#include cstdlib
#include ctime
#include conio.h
using namespace std;

#define MAX 15 // MAXIMUM CONTENTS IN QUEUE

class queue
{
private:
int t[MAX];
int added; // Addition End
int deleted; // Deletion End

public:
queue()
{
deleted = -1;
added = -1;
}

void del()
{
int tmp;

if ( deleted == -1 )
{
cout << "Queue is Empty";
}
else
{
for ( int j = 0 ; j <= added ; j++ )
{
if( ( j + 1 ) <= added )
{
tmp = t[j + 1];
t[j] = tmp;
}
else
{
added--;

if ( added == -1 )
{
deleted = -1;
}
else
{
deleted = 0;
}
}
}
}
}

void add( int item )
{
if( deleted == -1 && added == -1 )
{
deleted++;
added++;
}
else
{
added++;

if( added == MAX )
{
cout << "Queue is Full\n";
added--;
return;
}
}
t[added] = item;
}

void display()
{
if ( deleted != -1 )
{
for ( int i = 0 ; i <= added ; i++ )
cout << t[i] << " ";
}
else
cout << "EMPTY";
}
};

void main()
{
queue a;
int data[10] = { 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 9 , 10 };
int n , passCode;

do
{
srand(time(0));
n = rand();
passCode = n % ( ( data[9] - data[0] + 1 ) + data[0] );

cout << "Queue : ";
a.add( data[passCode] );
a.display();
cout << endl;

cout << "At Counter : ";
a.display();
cout << endl;

cout << "Transaction Time Left : " << endl;
cout << "Press ENTER to simulate 1 minute." << endl << endl;
}
while ( cin.get() );
}
AnswerRe: Can Sombody help ??? Pin
PJ Arends25-Apr-05 22:04
professionalPJ Arends25-Apr-05 22:04 
GeneralRe: Can Sombody help ??? Pin
khyap25-Apr-05 22:11
khyap25-Apr-05 22:11 
GeneralRe: Can Sombody help ??? Pin
Cedric Moonen25-Apr-05 22:22
Cedric Moonen25-Apr-05 22:22 
GeneralRe: Can Sombody help ??? Pin
khyap25-Apr-05 22:32
khyap25-Apr-05 22:32 
GeneralRe: Can Sombody help ??? Pin
Stlan25-Apr-05 22:55
Stlan25-Apr-05 22:55 
GeneralRe: Can Sombody help ??? Pin
khyap25-Apr-05 23:03
khyap25-Apr-05 23:03 
GeneralAcitveX container hanging problem Pin
kostik125-Apr-05 21:12
kostik125-Apr-05 21:12 
Generalimport a type lib in VS 2002&#8230; Pin
anderslundsgard25-Apr-05 20:46
anderslundsgard25-Apr-05 20:46 
Generalthe union and intercestion of two sets Pin
nuhcoskun25-Apr-05 20:16
nuhcoskun25-Apr-05 20:16 
GeneralRe: the union and intercestion of two sets Pin
LunaticFringe26-Apr-05 3:09
LunaticFringe26-Apr-05 3:09 
Generalvc++ explorer Pin
arnabpodder25-Apr-05 19:20
arnabpodder25-Apr-05 19:20 
GeneralRe: vc++ explorer Pin
ThatsAlok25-Apr-05 21:43
ThatsAlok25-Apr-05 21:43 
GeneralDriver or User Application Pin
phoenix1825-Apr-05 18:23
phoenix1825-Apr-05 18:23 
GeneralRe: Driver or User Application Pin
Blake Miller26-Apr-05 13:17
Blake Miller26-Apr-05 13:17 
GeneralGlobal Windows Message Problem Pin
outoolcoe25-Apr-05 17:49
outoolcoe25-Apr-05 17:49 
GeneralRe: Global Windows Message Problem Pin
PJ Arends25-Apr-05 18:23
professionalPJ Arends25-Apr-05 18:23 
GeneralRe: Global Windows Message Problem Pin
outoolcoe25-Apr-05 18:59
outoolcoe25-Apr-05 18:59 

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.