Click here to Skip to main content
15,889,462 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Regarding combo box Pin
CPallini10-Dec-07 22:01
mveCPallini10-Dec-07 22:01 
GeneralRe: Regarding combo box Pin
Chandrasekharan P10-Dec-07 23:59
Chandrasekharan P10-Dec-07 23:59 
Generalproblem with network programming Pin
Kogee San9-Dec-07 22:11
Kogee San9-Dec-07 22:11 
GeneralRe: problem with network programming Pin
Cedric Moonen9-Dec-07 22:24
Cedric Moonen9-Dec-07 22:24 
GeneralRe: problem with network programming Pin
CPallini9-Dec-07 22:43
mveCPallini9-Dec-07 22:43 
GeneralRe: problem with network programming Pin
Kogee San11-Dec-07 19:36
Kogee San11-Dec-07 19:36 
GeneralRead the first byte of a buffer Pin
CodingLover9-Dec-07 20:58
CodingLover9-Dec-07 20:58 
GeneralRe: Read the first byte of a buffer Pin
Cedric Moonen9-Dec-07 21:03
Cedric Moonen9-Dec-07 21:03 
GeneralRe: Read the first byte of a buffer [modified] Pin
toxcct9-Dec-07 21:24
toxcct9-Dec-07 21:24 
GeneralRe: Read the first byte of a buffer Pin
CodingLover9-Dec-07 23:46
CodingLover9-Dec-07 23:46 
GeneralRe: Read the first byte of a buffer Pin
toxcct9-Dec-07 23:51
toxcct9-Dec-07 23:51 
GeneralRe: Read the first byte of a buffer Pin
CodingLover9-Dec-07 23:54
CodingLover9-Dec-07 23:54 
GeneralRe: Read the first byte of a buffer Pin
CodingLover9-Dec-07 21:50
CodingLover9-Dec-07 21:50 
GeneralModulable programming Pin
Lord Kixdemp9-Dec-07 20:57
Lord Kixdemp9-Dec-07 20:57 
GeneralRe: Modulable programming Pin
Matthew Faithfull10-Dec-07 0:11
Matthew Faithfull10-Dec-07 0:11 
QuestionHow to Hide Caption Bar using SetWindowLong() Pin
santhoshv849-Dec-07 20:46
santhoshv849-Dec-07 20:46 
AnswerRe: How to Hide Caption Bar using SetWindowLong() Pin
Nishad S10-Dec-07 0:06
Nishad S10-Dec-07 0:06 
AnswerRe: How to Hide Caption Bar using SetWindowLong() Pin
Paresh Chitte10-Dec-07 0:39
Paresh Chitte10-Dec-07 0:39 
QuestionHow to enable Drag and Drop for tree view Pin
Javed Akhtar Ansari9-Dec-07 19:51
Javed Akhtar Ansari9-Dec-07 19:51 
GeneralC coding - structure Pin
chanduabcchandu9-Dec-07 18:35
chanduabcchandu9-Dec-07 18:35 
Answer[Message Deleted] Pin
Vince Rojas9-Dec-07 20:13
Vince Rojas9-Dec-07 20:13 
GeneralRe: C coding - structure Pin
toxcct9-Dec-07 21:01
toxcct9-Dec-07 21:01 
AnswerRe: C coding - structure [modified] Pin
Vince Rojas9-Dec-07 21:29
Vince Rojas9-Dec-07 21:29 
// Another way would be to use a linked list (is the code viewable?):


#include "stdlib.h" // FOR malloc()
#include "stdio.h"  // FOR printf()

struct tagMystruct {
    char *name;
    int nameLength;
    char *disign;
    int disgLength;
    struct tagMystruct *next;
};

typedef struct tagMystruct item;

// GLOBAL VARIABLES
item *curr, *head = NULL;

// FUNCTION DECLARATIONS
void AddEntry(char *name, int nameLength, char *disign, int disgLength);
void ShowEntries();

void main()
{
    AddEntry("Chandu", 6, "My Char", 7);
    AddEntry("Any name", 8, "Any disign", 10);

    ShowEntries();
}

void AddEntry(char *name, int nameLength, char *disign, int disgLength)
{
    curr = (item*)malloc(sizeof(item));
    curr->name = name;
    curr->nameLength = nameLength;
    curr->disign = disign;
    curr->disgLength = disgLength;

    curr->next = head;
    head = curr;
    curr = head;
}

void ShowEntries()
{
    while(curr)
    {
        printf("%s\n", curr->name);
        printf("%d\n", curr->nameLength);
        printf("%s\n", curr->disign);
        printf("%d\n\n", curr->disgLength);

        curr = curr->next;
    }
}


modified on Monday, December 10, 2007 3:42:36 AM

QuestionIs there an equivalent to CString Format in std::string ? Pin
uusheikh9-Dec-07 18:31
uusheikh9-Dec-07 18:31 
AnswerRe: Is there an equivalent to CString Format in std::string ? Pin
Stephen Hewitt9-Dec-07 19:37
Stephen Hewitt9-Dec-07 19:37 

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.