Click here to Skip to main content
15,916,432 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralThank you very much, Pin
transoft11-Jun-09 10:37
transoft11-Jun-09 10:37 
GeneralRe: Is there an easy way to change "... text ..." to _T("... text ...") for whole project? Pin
Rajesh R Subramanian11-Jun-09 10:45
professionalRajesh R Subramanian11-Jun-09 10:45 
QuestionProblem with sending keystroke to game. [modified] Pin
dirwir11-Jun-09 9:26
dirwir11-Jun-09 9:26 
AnswerRe: Problem with sending keystroke to game. Pin
Rajesh R Subramanian11-Jun-09 10:21
professionalRajesh R Subramanian11-Jun-09 10:21 
GeneralRe: Problem with sending keystroke to game. Pin
dirwir11-Jun-09 13:05
dirwir11-Jun-09 13:05 
Questioncreating a linked list Pin
steve_rm11-Jun-09 7:18
steve_rm11-Jun-09 7:18 
AnswerRe: creating a linked list Pin
Maximilien11-Jun-09 7:59
Maximilien11-Jun-09 7:59 
AnswerRe: creating a linked list Pin
David Crow11-Jun-09 8:26
David Crow11-Jun-09 8:26 
steve_rm wrote:
Many thanks for any suggestions,


Compare what you have to:

typedef struct product_data 
{
    int product_code;
    char product_name[PRODUCT_NAME_LEN];
    int product_cost;
  
    product_data *next;
} product_data_t;
  
typedef struct list
{
    product_data_t *head;
    product_data_t *tail;
} list_t;
  
// adds to end of list
void add(list_t *l, int code, char name[], int cost)
{
    product_data_t *node;
  
    // create a new node and populate its members
    node = new product_data_t;
    node->product_code = code;
    node->product_cost = cost;
    strcpy(node->product_name, name);    
    node->next = NULL;
  
    if (l->head == NULL)
        l->head = node;       // head points to new node
  
    if (l->tail != NULL)
        l->tail->next = node; // tail node points to new node
      
    // tail points to new node
    l->tail = node;           
}
  
void clean_up( list_t *l )
{    
    while (l->head != NULL)
    {
        product_data_t *node = l->head;
  
        // point head to next node in list
        l->head = node->next;
          
        delete node;
        node = NULL;
    }
}
  
void main(void)
{
    list_t l;
  
    l.head = NULL;
    l.tail = NULL;
  
    add(&l, 10, "Dell Inspiron", 1500);
    add(&l, 11, "Dell Inspirona", 1501);
    add(&l, 12, "Dell Inspironb", 1502);
    add(&l, 13, "Dell Inspironc", 1503);
      
    clean_up(&l);
}


"Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown

"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons


QuestionRe: creating a linked list Pin
steve_rm11-Jun-09 16:30
steve_rm11-Jun-09 16:30 
AnswerRe: creating a linked list Pin
David Crow12-Jun-09 3:29
David Crow12-Jun-09 3:29 
QuestionRe: creating a linked list Pin
led mike11-Jun-09 8:28
led mike11-Jun-09 8:28 
AnswerRe: creating a linked list Pin
steve_rm11-Jun-09 16:35
steve_rm11-Jun-09 16:35 
QuestionRe: creating a linked list Pin
David Crow26-Jun-09 7:51
David Crow26-Jun-09 7:51 
Questionset the parameter of CRichEditCtrl ::SetWindowText() Pin
MrKBA11-Jun-09 5:18
MrKBA11-Jun-09 5:18 
AnswerRe: set the parameter of CRichEditCtrl ::SetWindowText() Pin
Stephen Hewitt11-Jun-09 5:58
Stephen Hewitt11-Jun-09 5:58 
GeneralRe: set the parameter of CRichEditCtrl ::SetWindowText() Pin
MrKBA11-Jun-09 6:01
MrKBA11-Jun-09 6:01 
GeneralRe: set the parameter of CRichEditCtrl ::SetWindowText() Pin
Michael Schubert11-Jun-09 6:12
Michael Schubert11-Jun-09 6:12 
GeneralRe: set the parameter of CRichEditCtrl ::SetWindowText() Pin
MrKBA11-Jun-09 6:40
MrKBA11-Jun-09 6:40 
GeneralRe: set the parameter of CRichEditCtrl ::SetWindowText() Pin
Michael Schubert11-Jun-09 20:50
Michael Schubert11-Jun-09 20:50 
Questioncan you find the problem?? Pin
August Brower11-Jun-09 5:10
August Brower11-Jun-09 5:10 
AnswerRe: can you find the problem?? Pin
CPallini11-Jun-09 6:58
mveCPallini11-Jun-09 6:58 
AnswerRe: can you find the problem?? Pin
chirag_chauhan11-Jun-09 19:08
chirag_chauhan11-Jun-09 19:08 
QuestionHow to debug a DLL () running on the remote server using Visual studio 2005 Pin
ptr_Electron11-Jun-09 3:15
ptr_Electron11-Jun-09 3:15 
AnswerRe: How to debug a DLL () running on the remote server using Visual studio 2005 Pin
led mike11-Jun-09 4:32
led mike11-Jun-09 4:32 
AnswerRe: How to debug a DLL () running on the remote server using Visual studio 2005 Pin
chirag_chauhan11-Jun-09 19:16
chirag_chauhan11-Jun-09 19:16 

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.