Click here to Skip to main content
15,617,168 members

Comments by SVPro (Top 16 by date)

SVPro 6-Mar-13 21:16pm View    
Hi man,

When you use FindWindow, that means you wait a Window appear on desktop, and then Set title by SetWindowText. It's not satisfied my requirement (Set text before window appear).
SVPro 19-Jun-12 5:48am View    
No, It named STACK, but it's just a NODE of STACK!
SVPro 19-Jun-12 3:44am View    
You mean I need to malloc for stack in main function?
SVPro 19-Jun-12 3:35am View    
Deleted
Thank Griff,

But could you please help me to show your example, I don't understand so much!

#include <stdio.h>
#include <stdlib.h>

typedef struct node
{
int data;
struct stack *next;
}NODE;

typedef NODE *STACK;

void init(STACK *st)
{
(*st) = NULL;
}

int empty(STACK st)
{
if (st == 0)
{
return 1;
}
else
{
return 0;
}
}
void push(STACK *st, int value)
{
STACK p = (STACK)malloc(sizeof(STACK));
p->data = value;
if (empty(*st))
{
p->next = NULL;
*st = p;
}
else
{
p->next = *st;
*st = p;
}
}

void pop(STACK *st, int *x)
{
if (!empty(*st))
{
*x = (*st)->data;
STACK p = *st;
*st = (*st)->next;
free(p);
}
else
{
printf("Stack is underflow!\n");
}
}

int main()
{
STACK *st;
int data;
push(st,8);
push(st,12);
push(st,15);


pop(st, &data);
printf("Top = %d\n", data);

pop(st, &data);
printf("Top = %d\n", data);

pop(st, &data);
printf("Top = %d\n", data);

getch();
return 0;
}

This is my code, It works, but if I remove all of 'pop' function will cause a run-time error
SVPro 18-Apr-12 5:00am View    
Hi SAKryukov,

Thank you, so how do we hook Alt + other keys (A, B, C, D, E.....)
I'm successful with Ctrl + others keys (A, B, C...) but NOT with Alt + others key.

And hook up to 3 keys combination, 4 keys combination......
Thank you