Hi All..
I'm writting my own replacements for the memory allocation/deallocation routines
malloc() and free().In that file i'm using some variable names..
So after getting the header file, how can i use those previous variable names which i declared in mymalloc programme in any programme.
In my main programme i include <mymalloc.h> and do some variable declarations. but gcc said that some of those variable names already in the mymalloc..
So please help me to avoid this problem :S
aplh_ucsc
1
Light Poster
Recommended Answers
Jump to PostWhen writing a library you need to take care to only make the names that should be visible to client code extern; the rest should be static for file visibility. Names that are extern should be designed to avoid clashing with client code and other libraries as well. Finally, any …
All 2 Replies
Reply to this topic
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.