extern question

J

JoeC

I am trying to create a message box that allows you to enter a name
then display that name on a window. The program uses win32 but that is
not the issue. I want have a global buf variable. So that it can be
filled in the window then displayed in the main window.

Here is what I have

char * buf = NULL; //In my min program.

extern char * buf; // This is the section where I want buf displayed.

extern char * buf; //This is where I fill the array.
buf = new char[len];
GetDlgItemText(hwnd, IDC_NAME_EDIT, buf, len +1);


I have used extern before and it had made my progam possible but does
it work with a pointer?

I don't think this is a win32 issue.
 
E

Earl Purple

JoeC said:
I am trying to create a message box that allows you to enter a name
then display that name on a window. The program uses win32 but that is
not the issue. I want have a global buf variable. So that it can be
filled in the window then displayed in the main window.

Here is what I have

char * buf = NULL; //In my min program.

extern char * buf; // This is the section where I want buf displayed.

Don't really need to see any further. It is highly unlikely you want to
either use:

char *
globals
 
J

JoeC

Earl said:
Don't really need to see any further. It is highly unlikely you want to
either use:

char *
globals

Again I want to get data from one function to another and how best can
I do that?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,431
Messages
2,571,677
Members
48,796
Latest member
Greg L.

Latest Threads

Top