By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,346 Members | 2,158 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,346 IT Pros & Developers. It's quick & easy.

doubt in global variables

P: 2
I have created a array of structers a globaly in vc++. The structure format is

typedef struct Node
{

void *address;
int size;
struct Node *next;

}Node;

List Freelist[5],Alloclist[5];


And i defined two functiona. They are

myalloc(int size);
myfree(void *address);


when i made any modifications in myalloc() it will not viewed in the myfree().
how can i make it possible to view any modifications made in myalloc() to be viewed in myfree().


these two functions r to implement the malloc() and free() memoy management functions.

please help me.
Jun 18 '07 #1
Share this Question
Share on Google+
3 Replies


P: 55
Passing pointers. This is a scope problem which every C programmer will face this.
Jun 18 '07 #2

P: 2
Passing pointers. This is a scope problem which every C programmer will face this.


okay. Can u tell me a solution for this.
Jun 18 '07 #3

weaknessforcats
Expert Mod 5K+
P: 9,197
I have created a array of structers a globaly in vc++. The structure format is
If you are really using C++, then you should be using a vector. All of your effort to work with naked arrays is a complete duplication of the vector code.

Lastly, you do not ever use void* in C++.
Jun 18 '07 #4

Post your reply

Sign in to post your reply or Sign up for a free account.