Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

dynamic allocation using C...how to do it?

Status
Not open for further replies.

kiranpatil

Newbie level 3
Newbie level 3
Joined
Jul 5, 2006
Messages
3
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,297
Hi ,
I want to have an array of strings.
I want to write a function which will take two parameters namely
first one :- size of array.
Second one :- max size of each string.

I can pass these parameters and runtime i will have the array.

How to write such a fuction?
by that how to allocate memory dynamically in such scenario using malloc??
 

Hi

You have to use maloc,caloc,free lib function in order to allocate a dynamic memory area

Search google for maloc & c language to learn more

All the best

Bobi
 
  • Like
Reactions: tufail

    tufail

    Points: 2
    Helpful Answer Positive Rating
Hi ,
I now malloc syntax. I want to know how to write such function. Can anybody give the code snippet for the same.
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top