Stats: 3,182,463 members, 7,917,402 topics. Date: Sunday, 11 August 2024 at 05:24 AM |
Nairaland Forum / Science/Technology / Programming / How To Allocate Space For Ragged Array Using Calloc() Or Malloc? HELP! (1064 Views)
Write An Algorithm To Shuffle An Array / When Do I Use Calloc() And Malloc() In C Language? / Java Array Problem (2) (3) (4)
How To Allocate Space For Ragged Array Using Calloc() Or Malloc? HELP! by Nobody: 1:10pm On Dec 03, 2019 |
Please i have been trying to allocate a memory space for a ragged array (arrays of pointers of type char). but it happens that the two functions are not working. I used the assert function to know if the calloc() worked and it worked. My program do compile but when i enter a long string the program either terminates or jump to another memory location of the row index.
|
Re: How To Allocate Space For Ragged Array Using Calloc() Or Malloc? HELP! by Nobody: 1:19pm On Dec 03, 2019 |
Have you included stdlib library. |
Re: How To Allocate Space For Ragged Array Using Calloc() Or Malloc? HELP! by Nobody: 1:27pm On Dec 03, 2019 |
Ausrichie: yes. |
Re: How To Allocate Space For Ragged Array Using Calloc() Or Malloc? HELP! by Nobody: 1:45pm On Dec 03, 2019 |
BlaqTesla:Ahn what error did you get. And secondly check stdlib header if the function prototype was declared there had a problem with gets() sometime ago realised that gets() was obsolete. |
Re: How To Allocate Space For Ragged Array Using Calloc() Or Malloc? HELP! by Nobody: 2:00pm On Dec 03, 2019 |
Ausrichie: I have solved the problem already. Thanks |
(1) (Reply)
Am Hook Up At A Point In My Coding / Need Help On .net Programming / Please Does Anybody Know How To Use Matlab For Programming.please I Need it Urgently.
(Go Up)
Sections: politics (1) business autos (1) jobs (1) career education (1) romance computers phones travel sports fashion health religion celebs tv-movies music-radio literature webmasters programming techmarket Links: (1) (2) (3) (4) (5) (6) (7) (8) (9) (10) Nairaland - Copyright © 2005 - 2024 Oluwaseun Osewa. All rights reserved. See How To Advertise. 10 |