Click here to Skip to main content
15,886,919 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: [edited] collision response in a RTS Pin
Calin Negru29-Aug-23 0:41
Calin Negru29-Aug-23 0:41 
GeneralRe: [edited] collision response in a RTS Pin
Randor 29-Aug-23 5:24
professional Randor 29-Aug-23 5:24 
AnswerRe: [edited] collision response in a RTS Pin
Gerry Schmitz30-Aug-23 10:52
mveGerry Schmitz30-Aug-23 10:52 
GeneralRe: [edited] collision response in a RTS Pin
Calin Negru31-Aug-23 6:05
Calin Negru31-Aug-23 6:05 
GeneralRe: [edited] collision response in a RTS Pin
Gerry Schmitz1-Sep-23 6:26
mveGerry Schmitz1-Sep-23 6:26 
GeneralRe: [edited] collision response in a RTS Pin
Calin Negru2-Sep-23 7:35
Calin Negru2-Sep-23 7:35 
GeneralRe: [edited] collision response in a RTS Pin
Gerry Schmitz3-Sep-23 5:30
mveGerry Schmitz3-Sep-23 5:30 
QuestionDSA Pin
ZAID razvi25-Aug-23 0:50
ZAID razvi25-Aug-23 0:50 
Code Segment (I) :

int dequeue() {
if (isFull(f)){
printf("Queue Underflow! Nothing
to Dequeue");
}
int dqd =f->data;
f = f->next;
return dqd;
}

Code Segment (II) :

int dequeue(){
int val=-1;
struct Node *ptr=f;
if(f==NULL){
printf("Empty\n");
}
else{
f=f->next;
val=ptr->data;
free(ptr);
return val;
}
}

In Code I, DeQueue operation is being carried out directly using front pointer.

In Code II, The same is happening but this time another Node pointer is created to store the front pointer.

So, What's is the Difference in these two methods!
AnswerRe: DSA Pin
CPallini25-Aug-23 1:36
mveCPallini25-Aug-23 1:36 
GeneralRe: DSA Pin
ZAID razvi25-Aug-23 1:54
ZAID razvi25-Aug-23 1:54 
GeneralRe: DSA Pin
CPallini25-Aug-23 2:10
mveCPallini25-Aug-23 2:10 
GeneralRe: DSA Pin
ZAID razvi25-Aug-23 4:57
ZAID razvi25-Aug-23 4:57 
GeneralRe: DSA Pin
Richard Deeming28-Aug-23 21:34
mveRichard Deeming28-Aug-23 21:34 
GeneralRe: DSA Pin
ZAID razvi28-Aug-23 21:52
ZAID razvi28-Aug-23 21:52 
GeneralRe: DSA Pin
Andre Oosthuizen29-Aug-23 2:41
mveAndre Oosthuizen29-Aug-23 2:41 
GeneralRe: DSA Pin
Richard Deeming29-Aug-23 3:11
mveRichard Deeming29-Aug-23 3:11 
GeneralRe: DSA PinPopular
Richard MacCutchan28-Aug-23 21:56
mveRichard MacCutchan28-Aug-23 21:56 
GeneralRe: DSA Pin
Dave Kreskowiak29-Aug-23 2:04
mveDave Kreskowiak29-Aug-23 2:04 
GeneralRe: DSA Pin
Richard Deeming29-Aug-23 3:12
mveRichard Deeming29-Aug-23 3:12 
GeneralRe: DSA Pin
CPallini30-Aug-23 2:57
mveCPallini30-Aug-23 2:57 
QuestionInvalid application of 'sizeof' to incomplete type 'struct Node' Pin
ZAID razvi22-Aug-23 20:20
ZAID razvi22-Aug-23 20:20 
AnswerRe: Invalid application of 'sizeof' to incomplete type 'struct Node' Pin
Victor Nijegorodov22-Aug-23 20:41
Victor Nijegorodov22-Aug-23 20:41 
GeneralRe: Invalid application of 'sizeof' to incomplete type 'struct Node' Pin
ZAID razvi24-Aug-23 23:45
ZAID razvi24-Aug-23 23:45 
AnswerRe: Invalid application of 'sizeof' to incomplete type 'struct Node' Pin
CPallini22-Aug-23 21:06
mveCPallini22-Aug-23 21:06 
PraiseRe: Invalid application of 'sizeof' to incomplete type 'struct Node' Pin
ThatsAlok23-Aug-23 17:01
ThatsAlok23-Aug-23 17:01 

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.