Click here to Skip to main content
15,914,163 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Allocate memory inside function ?? Pin
fx920014-Mar-07 23:07
fx920014-Mar-07 23:07 
QuestionRe: Allocate memory inside function ?? Pin
prasad_som14-Mar-07 23:12
prasad_som14-Mar-07 23:12 
AnswerRe: Allocate memory inside function ?? Pin
fx920014-Mar-07 23:22
fx920014-Mar-07 23:22 
AnswerRe: Allocate memory inside function ?? Pin
prasad_som14-Mar-07 23:28
prasad_som14-Mar-07 23:28 
GeneralRe: Allocate memory inside function ?? Pin
fx920014-Mar-07 23:37
fx920014-Mar-07 23:37 
GeneralRe: Allocate memory inside function ?? Pin
Roger Stoltz15-Mar-07 0:43
Roger Stoltz15-Mar-07 0:43 
AnswerRe: Allocate memory inside function ?? Pin
fx920014-Mar-07 22:56
fx920014-Mar-07 22:56 
GeneralRe: Allocate memory inside function ?? Pin
fx920014-Mar-07 23:15
fx920014-Mar-07 23:15 
void fill(void *input);

struct mystruct {
char *ch;
int n;
};

#define ARG_SIZE sizeof(struct mystruct)

int main(){

void *ptr;
ptr = (void*) malloc (ARG_SIZE);

fill(ptr);

printf ("%i",((struct mystruct*)ptr)->n);
printf ("--%s",((struct mystruct*)ptr) ->ch);

return 0;
}


void fill(void *input){

struct mystruct* st;
st = (struct mystruct*) input;

st ->n = 3;//operation is ok
st->ch = (char *) malloc (3*sizeof(char));
strcpy(st->ch,"OK");
input = (void*) st;


QuestionRun exe from mfc Pin
jeepoo14-Mar-07 21:25
jeepoo14-Mar-07 21:25 
AnswerRe: Run exe from mfc Pin
prasad_som14-Mar-07 21:38
prasad_som14-Mar-07 21:38 
AnswerRe: Run exe from mfc Pin
ThatsAlok14-Mar-07 22:42
ThatsAlok14-Mar-07 22:42 
GeneralRe: Run exe from mfc Pin
Hamid_RT15-Mar-07 19:18
Hamid_RT15-Mar-07 19:18 
GeneralRe: Run exe from mfc Pin
ThatsAlok15-Mar-07 20:37
ThatsAlok15-Mar-07 20:37 
GeneralRe: Run exe from mfc Pin
Hamid_RT16-Mar-07 0:40
Hamid_RT16-Mar-07 0:40 
GeneralRe: Run exe from mfc Pin
ThatsAlok16-Mar-07 0:43
ThatsAlok16-Mar-07 0:43 
GeneralRe: Run exe from mfc Pin
Hamid_RT16-Mar-07 0:59
Hamid_RT16-Mar-07 0:59 
GeneralRe: Run exe from mfc Pin
ThatsAlok16-Mar-07 1:03
ThatsAlok16-Mar-07 1:03 
GeneralRe: Run exe from mfc Pin
Hamid_RT16-Mar-07 1:15
Hamid_RT16-Mar-07 1:15 
AnswerRe: Run exe from mfc Pin
David Crow15-Mar-07 2:59
David Crow15-Mar-07 2:59 
Questionhow to lunch 32 bit exe from 64 bit process Pin
aaaan14-Mar-07 21:00
aaaan14-Mar-07 21:00 
AnswerRe: how to lunch 32 bit exe from 64 bit process Pin
toxcct14-Mar-07 22:11
toxcct14-Mar-07 22:11 
GeneralRe: how to lunch 32 bit exe from 64 bit process Pin
aaaan14-Mar-07 23:17
aaaan14-Mar-07 23:17 
QuestionRe: how to lunch 32 bit exe from 64 bit process Pin
David Crow15-Mar-07 3:01
David Crow15-Mar-07 3:01 
QuestionHow to disable Modem as well as Ethernet Pin
VC_RYK14-Mar-07 19:58
VC_RYK14-Mar-07 19:58 
Questionread only combobox Pin
sulabh_expert@rediffmail.com14-Mar-07 19:47
sulabh_expert@rediffmail.com14-Mar-07 19:47 

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.