Can someone help me with a code in c? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Can someone help me with a code in c?

I need to make an 'easy' agend using struct and dynamic memory with a dynamic space for the number of contacts but idk the logic I should apply for it? I dont know much of c.

11th Nov 2019, 4:57 PM
Alejandra Diaz
Alejandra Diaz - avatar
8 Answers
0
Have you done some work or are we starting fresh on the code?
11th Nov 2019, 5:18 PM
Avinesh
Avinesh - avatar
0
Fresh. I got some examples but it doesnt help me with what I need.
11th Nov 2019, 5:21 PM
Alejandra Diaz
Alejandra Diaz - avatar
0
Alejandra Diaz What does your structure contain?
11th Nov 2019, 5:21 PM
Avinesh
Avinesh - avatar
0
Just name and number.
11th Nov 2019, 5:23 PM
Alejandra Diaz
Alejandra Diaz - avatar
0
Alejandra Diaz How many objects do you need? I mean how many contacts.
11th Nov 2019, 5:25 PM
Avinesh
Avinesh - avatar
0
At least 3 or 5 but in essence thats my problem. Teacher said that we dont know how many contacts do we need so it has to bee dynamic?
11th Nov 2019, 5:30 PM
Alejandra Diaz
Alejandra Diaz - avatar
0
Allocation of memory is dynamic but you need to know how much memory you need, so knowing the number allocates the required memory.
11th Nov 2019, 5:37 PM
Avinesh
Avinesh - avatar
0
Hmmmm... 🙄
13th Nov 2019, 2:28 AM
Kailash Jangir
Kailash Jangir - avatar