₦airaland Forum

Welcome, Guest: RegisterLoginWith GoogleTrendingRecentNew

Stats: 3,329,973 members, 8,443,252 topics. Date: Saturday, 11 July 2026 at 12:52 PM

Toggle theme

How To Allocate Space For Ragged Array Using Calloc() Or Malloc? HELP! - Programming - Nairaland

Nairaland ForumScience/TechnologyProgrammingHow To Allocate Space For Ragged Array Using Calloc() Or Malloc? HELP! (1242 Views)

1 Reply (Go Down)

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:
Have you included stdlib library.
yes.
Re: How To Allocate Space For Ragged Array Using Calloc() Or Malloc? HELP! by Nobody: 1:45pm On Dec 03, 2019
BlaqTesla:
yes.
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:
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.
I have solved the problem already. Thanks
1 Reply

Write An Algorithm To Shuffle An ArrayHow To Sort Array In Java With User Defined Method ?How To Empty An Array In Javascript234

Whatz Ur ExperienceSchool PortalSpectranet For Linux